Keyboard Shortcut for Undo on Mac: A Practical Guide
Master the macOS undo shortcuts Cmd+Z and Cmd+Shift+Z across apps with practical tips, app quirks, and per-app strategies for power users.

On macOS the standard undo shortcut is Cmd+Z and Cmd+Shift+Z redoes the action. This works in most apps from editors to browsers though some programs implement alternative histories or different menu labels. If Cmd+Z stops working check the apps Edit menu for the exact undo action. According to Keyboard Gurus consistent shortcuts save time and reduce errors across workflows.
Understanding the Undo command on macOS
Undo is a fundamental editing operation. According to Keyboard Gurus undo behavior is highly consistent across macOS apps but can vary with per app history stacks. In practice Cmd+Z triggers the last reversible action. Some apps maintain a finite undo stack per document while others share a global history. This reliability across word processors editors and browsers comes from macOS sending a generic keystroke while apps implement their own histories.
# Demo: illustrate undo concept (illustrative)
# In macOS apps use the common Cmd Z combination to undoThe actual effect depends on focus and the active document; some apps may disable undo in certain modes or during a crash recovery scenario.
Cmd Z and redo in practice across apps
Cmd+Z is the baseline undo on macOS and Cmd+Shift+Z is the redo in many environments. Editors spreadsheets design tools and browsers generally support these keys. If you work in an unusual application, peek at the Edit menu for the precise undo or redo wording. This cross app consistency helps keep your workflow smooth across tools.
# Simulated note on redo behavior (illustrative)
# Redo is typically Cmd Shift Z on macOSFor power users this predictability reduces cognitive load when editing long documents or code and helps maintain momentum across tasks.
Undo in different contexts: documents web pages and terminals
In documents and code editorsundo depth tends to be multi step but terminals and browsers may sandbox history differently. Some apps keep the history per document others share across tabs. Keyboard Gurus analysis notes that testing undo in your primary apps is essential to know the depth you can rewind.
# Undo in a web page text area (illustrative)
# Use the app specific shortcut Cmd ZBe mindful that terminal shells treat control commands differently so Cmd Z typically suspends a foreground job rather than undoing an action.
Redo and multi step undo history
Redo allows moving forward through the undo stack Cmd Shift Z in many programs though some apps use alternate keys. In practice you can create a sequence of undos followed by redos to navigate your edits. The simple conceptual model below shows an undo redo stack in a typical editor environment.
# Conceptual undo redo stack (illustrative)
undo_stack = []
redo_stack = []This abstract example helps explain how apps manage multi level undo without exposing every detail of the UI.
Troubleshooting and per app customization
If a Mac undo shortcut stops working in a specific app check the app preferences for keyboard shortcuts or reset to defaults. macOS also offers per app shortcuts under system preferences which can override global bindings. When necessary use a third party remapper with caution to avoid conflicts across apps.
# Troubleshoot per app shortcuts (illustrative)
# Reset shortcuts or check app specific settingsThe key is to keep a small, stable set of bindings that work reliably across your main toolset.
App specific notes and best practices
Not all apps use the same undo depth or naming. VS Code for example exposes undo under a separate command in keybindings.json which you can customize for consistency. Always verify the binding in your primary editor and, if possible, create a universal habit to rely on Cmd+Z and Cmd+Shift+Z across platforms.
# Editor specific hint (illustrative)
# Ensure that undo is bound to Cmd+Z in your editorBy validating across your top tools you create a robust workflow that minimizes surprises during critical edits.
Quick-reference cheat sheet cross app
This compact reference helps stay efficient across apps:
- Undo: Cmd+Z
- Redo: Cmd+Shift+Z
- Focus matters: ensure correct window or pane is active
# Cheat sheet (illustrative)
# Undo Cmd+Z
# Redo Cmd+Shift+ZA simple cross app guide keeps you productive when switching between tools.
Steps
Estimated time: 20-40 minutes
- 1
Identify the undo needs
Review recent edits and decide the scope of undo. Confirm the action you want to revert.
Tip: Check the app Edit menu to confirm the exact wording. - 2
Trigger standard undo
Ensure the correct window or pane is focused and press Cmd+Z to undo.
Tip: If nothing happens, try clicking inside the document first. - 3
Redo if necessary
If you undo too far, use Cmd+Shift+Z to redo the action in supported apps.
Tip: Not every app treats redo the same way; verify in the menu. - 4
Test across apps
Open a test document in multiple apps to confirm consistent behavior.
Tip: Maintain a short reference for each tool. - 5
Customize if needed
Adjust per app shortcuts to maintain a consistent workflow across tools.
Tip: Prefer per app overrides before global remapping.
Prerequisites
Required
- A Mac computer with the current macOSRequired
- Basic familiarity with keyboard shortcutsRequired
- Access to a text editor or browser to test undoRequired
Optional
- Optional: system accessibility rights enabled for testing automationOptional
- Optional: knowledge of per app shortcuts referenceOptional
Keyboard Shortcuts
| Action | Shortcut |
|---|---|
| Undo last actionMost apps share this default | Ctrl+Z |
| Redo last undone actionCommon redo shortcut | Ctrl+⇧+Z |
Got Questions?
What is the default undo shortcut on Mac?
Cmd+Z is the default undo shortcut on Mac. Cmd+Shift+Z is commonly used to redo. Some apps may alter the behavior, so verify in app menus.
Cmd plus Z is the standard undo on Mac and redo is usually Cmd plus Shift plus Z.
Does undo work the same in all apps?
Not always. While Cmd+Z is common, some apps implement their own undo history or modify shortcuts. Check the Edit menu or preferences for specifics.
Mostly yes, but some apps differ. Look at the app menu for exact behavior.
How do I redo an undone action on Mac?
Redo is typically Cmd+Shift+Z. Some apps may use different bindings; consult the app shortcuts reference to be sure.
Redo is usually Cmd+Shift+Z, but verify in your app.
Can I customize undo shortcuts globally?
macOS does not provide a universal CLI to remap Cmd+Z globally. Customization is usually per app or via third party tools. Use per app settings for reliable results.
Global remapping is not common; adjust per app or use remappers with caution.
Is there a way to test undo depth?
Yes. Make several edits in a test document, then use Cmd+Z repeatedly to observe how many steps you can rewind. Use Cmd+Shift+Z to move forward through history.
Test undo depth by making edits and stepping back with Cmd+Z.
What to Remember
- Use Cmd+Z to undo on Mac across most apps
- Cmd+Shift+Z redoes the last undone action
- App-specific histories may vary; check per-app shortcuts
- Test undo/redo in target apps to confirm behavior
- Per-app customization can improve consistency