How to cancel the last order on an unsuccessfull payment?

Context: How to cancel the last order and restore the last quote on an unsuccessfull payment?

An example:

Details: