On a Windows PC, press Ctrl+Z; on a Mac, press Command-Z to undo the last action. A missed keystroke or wrong edit can interrupt your work, especially when you are focused on the text or file in front of you.
Undo history is the sequence of recent actions an app can reverse. The Undo Shortcut Key for Windows and Mac works in many apps, but the result depends on the app and the action. This guide gives you the key steps and shows what to try when an undo does not work as expected.
Key Takeaways
- Use Ctrl+Z to undo on Windows.
- Use Command-Z to undo on a Mac.
- Press the shortcut again to reverse another action when the app supports it.
- Use the matching redo shortcut if you undo too much.
- Check the app’s Edit menu when a keyboard shortcut fails.
If a shortcut does not work in an app, look for Undo in its Edit menu.
What Is the Undo Shortcut Key for Windows and Mac?
Ctrl+Z is the Windows undo shortcut, while Command-Z is the Mac equivalent. In a text editor, either key combination can remove your last typing or reverse another recent action. The app must support undo for the shortcut to work.
The modifier key is the key you hold while pressing the final key. On a Mac, hold Command first, then press Z; keep Command held until Z is pressed. On Windows, hold Ctrl while pressing Z.

Use Ctrl+Z on Windows and Command-Z on a Mac, but let the app decide which recent action it can reverse.
The same keys may behave differently across apps, so a text editor is a simple place to test them. If you work in a code editor, features and key settings can vary; compare code editors for different workflows before settling on one.
Undo on Windows
On Windows, Ctrl+Z reverses the previous action in an app that supports undo. In text editing, it usually removes the last typing you entered. It may also reverse a recent format change or another edit, depending on the app.
Ctrl+A is a different keyboard shortcut. It selects all text in text-editing controls, or all items in a window. The key combination does not undo anything.
Undo on Mac
On a Mac, Command-Z undoes the previous command. For example, if you type a sentence in a text editor, Command-Z can remove that typing. The command can also reverse another supported change.
Mac modifier keys come first in the sequence: hold Command, then press Z. The key labels may look different from Windows, but both systems use a modifier and a final key for this shortcut.
| Action | Windows | Mac |
|---|---|---|
| Undo a previous action | Ctrl+Z | Command-Z |
| Undo typing in a text editor | Ctrl+Z | Command-Z |
| Select all | Ctrl+A | Command-A |
In a text editor, try the shortcut immediately after typing the text you want to remove.
Can Ctrl+Z Undo More Than One Action?
Pressing Ctrl+Z again can undo another action, but only if the app supports it. Each press can reverse one more recent step in the app’s undo history. Repeated undo follows the app’s order and limits.
Before you press the key again, check what changed after the last undo. A second press may remove a different edit, move a file back, or reverse another action. Windows shortcut behavior can vary by app, and Microsoft’s listed shortcuts are defaults.

Repeating undo in Windows
Use this sequence to reverse changes one at a time:
- Focus the app where the change happened.
- Press Ctrl+Z once.
- Press it again only if you want to reverse the next action.
For example, Ctrl+Z can undo recent file deletion, movement, or renaming in File Explorer. In Windows 11, you can also use File Explorer’s Undo command from the three-dot toolbar menu. That option can help when you do not want to use the keyboard.
File Explorer handles files, while text apps handle edits in their own order. If you switched apps after making a change, return to the app that made it before trying undo. Otherwise, the shortcut may affect a different action or do nothing.
Access keeps an ordered undo history
Access can undo and redo up to 20 typing or design actions. It handles those actions in order, without letting you skip to an earlier one. A design edit and a typing change both count as actions in that sequence.
If you have changed several fields or design settings, reverse them one at a time. Watch the form or design view after each press so you can stop at the right point. Access does not let you jump past an unwanted step in its history.
In Access, stop when the desired change is restored, since its undo history must be followed in order.
What Shortcut Redoes an Undone Action?
To reverse an undo, press Ctrl+Y on Windows or Shift-Command-Z on a Mac. Redo brings back an action that you just reversed, so it can recover an edit after you undo too much. Redo moves forward through an undo, not backward through a new edit.
The Windows key is Ctrl+Y, not Ctrl+Z. Ctrl+Z undoes an action, while Ctrl+Y redoes an action that Ctrl+Z previously reversed. The difference matters when several steps are involved.

Redo on Windows
Use Ctrl+Y to redo an action you have undone with Ctrl+Z. For example, if you remove a sentence by mistake and undo that removal, Ctrl+Y can restore the sentence. The app must support redo, and it must still have that action available.
Some apps use other controls or offer a Redo command in the Edit menu. Look for the command name if Ctrl+Y does not work. A button near the top of the app may also show the redo action.
Redo on Mac
On a Mac, Shift-Command-Z redoes an action and reverses an undo. Hold Shift and Command, then press Z. This is different from Command-Z, which undoes a recent command.
Some Mac apps support multiple undo and redo commands, so you can move through more than one step. The exact result depends on the app and its current history. A new edit may change which earlier actions remain available.
Undo and redo work as a pair in many apps, but they do not always use the same final key. Use the app’s menu when its shortcut differs from the one you expect.
If you have undone too many steps, use redo promptly before making a different edit.
How Do Undo Limits Differ by App?
The app matters: Access, Pages, and Microsoft Office do not all handle undo history in the same way. Their commands and limits shape which changes you can restore. Office defaults to 100 undoable actions.
The shortcut table gives the usual keys for each app. Menus can help when an action is unavailable or a key combination does not match your setup. Access also changes its Undo command when it cannot reverse the latest action.

| App | Undo | Redo |
|---|---|---|
| Access | Ctrl+Z | Ctrl+Y |
| Pages on Mac | Command-Z or Edit > Undo | Command-Shift-Z or Edit > Redo |
| Word, PowerPoint, and Excel on Windows | Ctrl+Z | Ctrl+Y or F4 |
Access actions that can be undone
In Access, Ctrl+Z undoes the most recent data-entry or design change. Ctrl+Y redoes the most recent action you undid. When Access cannot reverse an action, its Undo command changes to “Can’t Undo.”
That label tells you the latest action is outside the app’s undo support. Check the command before you rely on it to recover a data-entry or design change.
Undo and redo in Pages
Pages on Mac offers Undo from Edit > Undo or Command-Z. To redo, use Edit > Redo or Command-Shift-Z. The menu gives you a clear option when you prefer not to use keyboard shortcuts.
Pages and Access use different menu paths and key combinations for redo. If you move between them, use the app name in the menu as your guide, rather than assuming every command matches.
The undo history in Microsoft Office
Word, PowerPoint, and Excel have a default undo limit of 100 actions. You can undo changes after saving, as long as they remain within that limit. The Microsoft Office undo-limit guide explains how the limit can be changed through the Windows Registry.
Some File tab commands cannot be undone, and saving itself cannot be undone. Running an Excel macro clears the undo stack, so earlier actions are no longer available through undo. Those limits apply even when the app’s standard undo shortcut works for other edits.
In Office, treat saving and running an Excel macro as points where the undo history may not protect the change.
Which Other Shortcuts Handle Windows, Terminal, and Browser Tabs?
Command-Grave Accent moves between windows of the app you are using on a Mac. Other shortcuts handle navigation or deletion, rather than undoing an edit. Control-K in Mac Terminal deletes command-line text; it is not a general undo command.
These keys help with a window change, a closed browser tab, or text on a command line. The key names can be easy to mix up, so check the action before pressing a shortcut.
Control-K in Terminal deletes from the insertion point to the end of the command line, so check where the cursor sits first.
Mac window and Terminal shortcuts
Command-Grave Accent switches to the next window in the current Mac app. Shift-Command-Tilde switches to the previous window. These combinations move between windows without changing the text or file you are editing.
Control-K in Mac Terminal removes the command-line text from the insertion point to the end of the line. If the cursor sits near the start, much of the command can disappear. Its result differs from a standard undo command.
- Command-Grave Accent: switch to the next window in the current Mac app.
- Shift-Command-Tilde: switch to the previous window.
- Ctrl+Shift+T: reopen a closed tab or window in Chrome, Edge, or Firefox.
Reopen a closed browser tab in Windows
In Chrome, Edge, and Firefox, Ctrl+Shift+T reopens the last closed tab or window. You can repeat the shortcut to bring back multiple recently closed tabs. This restores a browser view, not an edit you removed from a page.
If you often manage many open tabs, OneTab and other tab tools can save tabs in a list for later. That helps manage open pages, but it does not undo a change or reopen a recently closed tab.
In Terminal, check the insertion point before pressing Control-K because it deletes the rest of that command line.
Conclusion
Keep Ctrl+Z in mind on Windows and Command-Z on a Mac as your first attempt to reverse an unwanted edit. These keyboard shortcuts can save a change when the app still has it in its undo history.
If a shortcut behaves differently than expected, check the app’s Edit menu for Undo or Redo. Try the appropriate key the next time you make a small, reversible edit, and confirm the result before continuing.
FAQ
What is the key Command for undo on a Mac?
Press Command-Z to undo the previous command on a Mac. Hold Command, then press Z; keep Command held until you press the final key. In a text editor, the shortcut can remove the typing you just entered. The app controls which actions it can reverse, so the result may differ between programs.
How to go to another window using keyboard in Mac?
Press Command-Grave Accent to switch to the next window in the current app, or Shift-Command-Tilde to switch to the previous one. The Grave Accent key usually shares a key with the tilde symbol. These shortcuts move between windows of one app, rather than cycling through every open app on your Mac.
What is Ctrl+K on Mac?
In Mac Terminal, Control-K deletes text from the insertion point to the end of the command line. It does not act as the general undo command. Check the cursor position before pressing it, since text after that point can disappear. In text-editing controls, Control-K can behave differently, depending on the app.
Is Ctrl+Y undo?
No. In Windows, Ctrl+Y redoes an action previously undone with Ctrl+Z. For example, if you undo a typing change and then decide you wanted to keep it, Ctrl+Y may restore it. The app must support redo, and the action must still be available in its history.
What is Ctrl+A to Z?
Ctrl+A to Z refers to separate keyboard combinations, not one command that runs through the alphabet. Each letter can have a different function in an app. For example, Windows Ctrl+A selects all text in text-editing controls and all items in a window. Other combinations depend on the program you are using.


