Most applications include an ‘Undo’ option in the ‘Edit’ menu, or a shortcut can usually be used (Command+Z).