Edit>Undo (shortcut: Control-Z) reverses the most recent editing command. For example, this can be used to restore unintentionally deleted text. More complicated operations, such as a search and replace, can also be undone. By default, information about the last 100 edits is retained; older edits cannot be undone. The maximum number of undos can be changed in the Editing pane of the Utilities>Global Options dialog box.
If you undo too many changes, Edit>Redo (shortcut: Control-R) can restore the changes again. For example, if some text was inserted, Undo will remove it from the buffer. Redo will insert it again.