Using "Undo" command, you can undo actions, depending on the memory available to your system. You can undo an action after you've saved a file, but not after you've closed and reopened it.
To undo the last operation:
Choose Edit > Undo.
If an operation can't be undone, the command is dimmed and changes to Can't Undo.
Hotkey for this command is CTRL + Z.