You can undo recent changes you make to a document then redo them if you change your mind.
Undo the last action: Choose Edit > Undo (from the Edit menu at the top of your screen), or press Command-Z.
Redo the last action you undid: Choose Edit > Redo, or press Command-Shift-Z.
If you want to delete all the changes you made since you opened a document, you can restore the document to its state when you opened it.