If you'd like to use a keyboard shortcut to Undo the previous action you just performed, press Command+Z on your Mac keyboard. This is equivalent to selecting Edit > Undo in the menu bar. (It's also similar to pressing Ctrl+Z on a Windows PC.)