Command Z is the standard keyboard shortcut for Undo on macOS. Press and hold the Command (⌘) key, then press Z to reverse your last action in most apps. On Windows and Linux, the equivalent is Ctrl+Z. This guide explains how to use Command Z, what it can and cannot undo, and how to fix it when it stops working.

What You'll Need

  • A Mac (MacBook, iMac, Mac mini, or Mac Pro) running a current version of macOS.
  • A keyboard with a working Command key. On some third-party keyboards, the Command key may be labeled with a ⌘ symbol or a Windows key that maps to Command.
  • The app where you want to undo an action must be in focus (the active window).

Step-by-Step

  1. Click on the window of the app where you made the change. The app must be the active application; Command Z only affects the frontmost app.
  2. Locate the Command key. On Apple keyboards it is next to the Space bar, labeled with ⌘ and the word “command”. On non-Apple keyboards, it may be the key labeled “Windows” or “Super”.
  3. Press and hold Command, then press Z once. Release both keys. The last action in that app should be reversed.
  4. If you need to undo multiple actions, press Command Z repeatedly. Each press steps back one action, up to the limit set by the app.
  5. To redo an action you just undid, press Command Shift Z. This is the standard Redo shortcut on macOS. Some apps also accept Command Y, but Command Shift Z is more common.
  6. If the app has an Edit menu, you can verify the shortcut by opening Edit and looking for “Undo” next to the Command Z symbol. The menu item will be grayed out if there is nothing to undo.
  7. For text editing, you can also undo by selecting Edit > Undo from the menu bar. This is useful if your keyboard is not responding.

Menu labels and shortcut behavior can differ slightly between macOS versions, apps, and regions. For example, some apps use a different redo shortcut or limit undo history to a certain number of steps.

Common Mistakes

  • Pressing Command Z while the wrong app is active. Always click the app window first.
  • Using Ctrl+Z on a Mac. That is the Windows shortcut; on macOS it usually does nothing or triggers a different command.
  • Expecting Command Z to undo actions that are not reversible, such as sending an email, deleting a file from Finder (unless you immediately use Undo), or changes made by another person in a shared document.
  • Holding Command and pressing Z too slowly or too many times, which can undo more than intended. Press deliberately, one step at a time.
  • Assuming Command Z works in every app. Some apps, especially games and certain utilities, do not support undo.

Tips

  • Learn the redo shortcut: Command Shift Z. It saves time when you undo too far.
  • In text fields, you can often undo typing in chunks. Each Command Z removes the last word or sentence, depending on the app.
  • If you use a Windows keyboard with a Mac, you can remap the Windows key to Command in System Settings > Keyboard > Keyboard Shortcuts > Modifier Keys. Labels may vary by macOS version.
  • Some apps let you increase the undo history in their preferences. Check the app's settings if you need more steps.
  • For Finder file operations, Command Z works immediately after moving or renaming a file. After a while, the undo may no longer be available.

Troubleshooting

If Command Z does not work, try these steps in order:

  1. Make sure the correct app is active. Click inside the document or window you want to affect.
  2. Check that the Command key is not stuck or disabled. Test another Command shortcut, such as Command C (copy). If that also fails, the keyboard or key may be the problem.
  3. Open the Edit menu. If “Undo” is grayed out, there is nothing to undo in that app at that moment.
  4. Restart the app. Save your work first if possible. Quit the app completely (Command Q) and reopen it.
  5. Restart your Mac. This clears temporary glitches that can affect keyboard shortcuts.
  6. Check for app updates. An outdated app may have a bug that breaks undo.
  7. If you use a third-party keyboard, try a different keyboard or check its configuration software. Some keyboards have a mode that changes key behavior.
  8. If only one app is affected, check its preferences for a setting that disables undo or changes the shortcut. If no such setting exists, contact the app's support.

Warning: Do not reset your Mac or erase your disk to fix a keyboard shortcut. That deletes all data. Exhaust the simpler steps first.

Frequently Asked Questions

What does Command Z do?

It undoes the last action in the active app, such as typing, deleting, moving a file, or formatting text.

How do I redo after undoing?

Press Command Shift Z. In some apps, Command Y also works.

Can I undo multiple times?

Yes, press Command Z repeatedly. The number of undo steps depends on the app.

Why is Command Z not working?

Common causes: the wrong app is active, there is nothing to undo, the keyboard key is faulty, or the app does not support undo.

Is Command Z the same as Ctrl+Z?

Functionally yes, but Command Z is for macOS and Ctrl+Z is for Windows and Linux. They are not interchangeable across systems.

Does Command Z work in all apps?

No. Most text editors, browsers, and productivity apps support it, but some games and utilities do not.