Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Undo Command Z on Mac: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

On a Mac, undo is Command + Z, and redo is Command + Shift + Z. Press Command + Z once to reverse your last action; press it repeatedly to step further back through your recent history. This works in most apps, from TextEdit and Pages to Finder file operations and many third-party apps, though the exact depth of the undo history varies by app. Nothing needs to be installed or enabled first—the shortcut is built into macOS and the apps you use. The steps below cover the shortcut, the menu equivalent, what to do when it does not respond, and how it differs from undo in specific situations like renaming files or editing photos.

What You'll Need

  • A Mac running a current version of macOS (the shortcut has been standard for many years).
  • The app where the change happened still open, if possible. Closing the app or the document usually clears its undo history.
  • A keyboard with a working Command (⌘) key. On a non-Apple keyboard, the Windows key usually acts as Command.

Step-by-Step

  1. Make sure the right window is active. Click once inside the document, text field, or window where the change occurred. Undo applies to the frontmost app and the active document, so clicking elsewhere first can send the command to the wrong place.
  2. Press Command + Z. Hold the Command key (next to the space bar) and tap Z. The last action—typing, deleting, moving a file, applying a format—is reversed. If you are in a text field, the cursor returns to where it was before the change.
  3. Press it again to go further back. Each press undoes one more action, in reverse order. Most apps keep a limited history, so you can usually step back several edits but not indefinitely. Stop when the content looks right.
  4. Use the menu if the shortcut does not respond. Open the Edit menu in the menu bar and choose Undo (it often names the action, such as "Undo Typing"). This is the same command and confirms whether the app supports undo at that moment. Menu labels can differ slightly by app and macOS version.
  5. Redo if you went too far. Press Command + Shift + Z, or choose Edit > Redo, to reapply the action you just undid. Redo is only available immediately after an undo and is cleared once you make a new edit.
  6. Check Finder-specific undo. In Finder, Command + Z reverses the last file operation such as a move, rename, or move to Trash. If you renamed a file, the undo restores the previous name. If you moved something to the Trash, undo puts it back. Note that emptying the Trash cannot be undone with Command + Z.
  7. For photos and media, use the app's own undo. In Photos, Command + Z reverses edits made in the editing view while you are still there. In many creative apps, undo history is per-document and may be lost when you close the file, so finish undoing before closing.
  8. Save after you are satisfied. Undo changes are not saved until you save the document (Command + S) in apps that require saving. In apps with automatic saving, the change is kept automatically.

Common Mistakes

  • Pressing Command + Z in the wrong app. If you click into another window first, the undo goes to that app's active document, not the one you meant to fix. Always confirm the frontmost window.
  • Expecting undo after closing a document. Closing a document or quitting an app usually discards its undo history. Reopen the file and check whether the app kept a version history before assuming the change is lost.
  • Confusing undo with reverting a saved file. Command + Z reverses recent actions in the open document; it does not roll a file back to an earlier saved state. For that, use the app's version history or your backups.
  • Assuming Command + Z works everywhere. Some apps, full-screen media players, and system dialogs do not support undo. In those cases the menu item is greyed out and no shortcut will help.
  • Using the wrong modifier on a Windows keyboard. On a PC keyboard paired with a Mac, the Windows key typically maps to Command. If Command + Z does nothing, try the key labelled Alt or Windows depending on how macOS mapped it.

Tips

  • Command + Z is the same in nearly every Mac app; learn it once and it applies broadly.
  • If you are unsure what will be undone, open the Edit menu first—it names the exact action at the top, such as "Undo Paste" or "Undo Move."
  • Redo is Command + Shift + Z. Some apps also accept Command + Y, but Shift + Z is the standard Mac shortcut.
  • In text-heavy work, undo steps back one edit at a time. Pause and check the text rather than holding the keys, which can roll back further than intended.
  • For important documents, save a copy before making large changes so you have a fallback beyond the undo history.

Troubleshooting

If Command + Z does nothing, work through these checks in order, simplest first.

  1. Click into the correct window. The most common cause is that another app or document is active. Click the window you want to fix, then try again.
  2. Check the Edit menu. If Undo is greyed out, the app has no action to reverse—either nothing has changed since the last save, or the app does not support undo in that view. This is normal in some system dialogs and media players.
  3. Confirm the keyboard mapping. Test the Command key with another shortcut, such as Command + C. If that fails, the key or keyboard connection is the problem, not undo.
  4. Restart the app. Quit the app fully (Command + Q) and reopen it. Be aware this usually clears the undo history, so only do it if you have accepted that the change may need to be reversed manually.
  5. Check for app updates. Install updates through the App Store or the app's own updater, since undo behaviour can be fixed in newer versions.
  6. Use version history or backups. If the change was saved and undo is no longer available, look for the app's version history (common in document apps) or restore from a Time Machine backup. Restoring a file replaces its current contents, so copy the current version elsewhere first if you may need it.

Frequently Asked Questions

What is the undo shortcut on a Mac?

Command + Z. It reverses the most recent action in the active app and can be pressed repeatedly to step further back, up to the app's history limit.

How do I redo after undoing on a Mac?

Press Command + Shift + Z, or choose Edit > Redo. Redo is available only until you make a new edit, which clears the redo history.

Does Command + Z work in Finder?

Yes, for the last file operation such as a move, rename, or move to Trash. It cannot undo emptying the Trash or most permanent deletions.

Why is Command + Z not working?

Usually because the wrong window is active, the app has no undoable action, or the menu item is greyed out. Click the correct window and check the Edit menu first.

Can I undo after closing a document?

Generally no—closing a document or quitting an app clears its undo history. Use the app's version history or a backup to recover an earlier state.

Is undo the same as reverting a saved file?

No. Undo reverses recent actions in the open document; it does not restore an earlier saved version. For that, use version history or backups.