Ok. I am sorry my concern was not more clear.
See, when a user adds a product to the cart then we see the same in a cart module (i.e. the summary of the products added in the cart). So when a user wants to go ahead and click for payment he can make the payment through credit card etc. Now what I WANT to develop the solution here, that is 'by mistake' when the user clicks on the 'delete' button or Cancel button on the 'x' instead of the continue to payment button, the default functionality takes to the main page. I don't want this to happen, I want the customer to stay on the same latest product page from where he has added the product to the cart.
To summarize, I want to enable the undo action with the help of radio button or any similar button .
I hope my concern is more clear.