Undo and Redo
Choose Undo in the top toolbar to reverse the last edit. One painting or erasing stroke counts as one edit, including a multi-tile stamp. Choose Redo to reapply an edit you undid.
On desktop, use Ctrl+Z or ⌘Z for Undo. Use Ctrl+Shift+Z or ⌘Shift+Z for Redo.