Add a step to revert unsaved changes

I took the key part from PR #3183 and added it to the post-confirmation
flow.