How can i revert back the changes
===

I am having a button named **"Store"** in the ribbon.After selecting a component under **"component presentation tab"** i am fetching page Id component id and template id and passing it through querystring to a aspx page. I am having a textbox and a button **"Go"** on the popup page. there i am storing these id with an additional text in a text file name log.txt like : **pgid|componentID|templateID|textboxtext** on click of "Go", Now on every selection of component and clicking the "Store" in ribbon selected id will pass as a string and on click of "Ok" it will store the pgid|componentID|templateID|textboxtext in log.txt .If someone will select the same component whose id already got stored in text file after clicking the button "Store" in ribbon it will populate the textboxtext in the textbox related to the corespond id. On editing the reloaded text and clicking "ok" button on the popup page it will again store the edited value after deleting the previous one.
Now if user wants to leave the page then he needs to select "Save and close" and exit, but if user leaves the page without selecting "Save and close" button it should revert back the changes made on the popup page textbox  and on selecting the same component again it should populate the old value not the edited value. Any suggestion how to revert it back.
