Undo Keyboard Shortcut: Ctrl+Z and Cmd+Z Explained
The undo keyboard shortcut is Ctrl+Z on Windows and Linux, or Cmd+Z on Mac. Find redo keys across apps and what to try when undo fails, too.

The short versionThe undo keyboard shortcut reverses a recent change in an app, usually one action at a time. Press Ctrl+Z on Windows or Linux, or Command+Z on a Mac; redo restores an undone change, though its shortcut and history limits vary by app. Undo makes editing mistakes quick to fix, but it cannot reverse every action, and shared documents may undo someone else’s work depending on the app.
Typed the wrong sentence or deleted a paragraph you still needed? Your hands usually reach for the fix before your brain catches up. That reflex is undo, and it’s the fastest way to take back a mistake without leaving the keyboard.
The short answer: press Ctrl+Z on Windows and Linux, or Cmd+Z on a Mac. Redo reverses an undo, usually with Ctrl+Y or Ctrl+Shift+Z (Cmd+Shift+Z on a Mac).
We’ll cover each app’s quirks, what to try when undo fails, and a desk setup that keeps your hands off the mouse.
How the Undo Keyboard Shortcut Behaves
Ctrl+Z (Cmd+Z on a Mac) looks simple, but its reach depends on the app and on who else is editing, so we’ll cover each case.
Why undo lets you explore freely
Consider a remote bookkeeper who sorts a column to check a total, sees the numbers shift, and presses Ctrl+Z to restore the original order. Hands stay on the keys.
- Reverts to an older state. Each press rewinds one change instead of the whole file.
- Explore without fear of mistakes. Nothing is locked in, so you can try a bolder layout and back out in seconds.
- Predictable, covers undoable commands. Undo works on every command the app can reverse, so one rule covers typing, formatting, and editing.
Actions undo cannot reverse
Undo covers changes to your content, not everything you do on screen.
- Saving a file isn’t undoable. Once you save, undo can’t take that save back, so copy the file before a risky edit.
- Scrolling and selection are excluded. Moving around or highlighting text doesn’t create an undo step, so Ctrl+Z won’t return you to where you were looking.
How far back undo can go
The limit depends on the app and sometimes on its settings.
- Photoshop’s default is 20 steps. Past that, undo can’t reach back any further.
- Paint went from 3 edits to 50, so the same Ctrl+Z can reach much further.
- Single vs. multi-level undo. Single-step undo reverts only your last action, while multi-level undo lets you keep stepping back. A paper on a temporal model for multi-level undo and redo notes that undo systems may support either approach.
- Flip undo model. Some apps order their undo steps differently, so check the help menu if undo lands somewhere unexpected.
Undoing edits when others work too
In a shared document, your Ctrl+Z can reach into a teammate’s work.
- Global undo reverts the latest edit. It rolls back the most recent change, no matter who made it.
- Local undo reverts your own actions. It steps back only through your changes, so a teammate’s edits stay put.
Picture a home-based support agent co-editing a help article. After a typo, they press Ctrl+Z, and under global undo that one keystroke could erase the paragraph their colleague just added.
Knowing which model your app uses lets you fix your own slip without touching anyone’s work.
Undo Keys for Each Operating System
Undo is the shortcut you’ll use most, and its keys shift a little between Windows and Mac. Here’s what to press on each system, and how to reach it without the mouse.
What is the undo shortcut for text?
In most Windows apps and text editors, the undo shortcut is Ctrl+Z. Hold Ctrl and tap Z to reverse the last change, and press it again to step back further.
Redo is Ctrl+Y, and many apps also accept Ctrl+Shift+Z, so use whichever your fingers already know.
Consider a remote support agent who accidentally deletes a customer’s order number mid-reply. One Ctrl+Z restores it, and the agent never leaves the keyboard. Your hands never leave the home row.
Mac keys for undo and redo
On a Mac, undo is Command+Z and redo is Command+Shift+Z. Command sits next to the space bar and takes the place of Ctrl: same action, different key.
| Action | Windows | Mac |
|---|---|---|
| Undo | Ctrl+Z | Command+Z |
| Redo | Ctrl+YorCtrl+Shift+Z | Command+Shift+Z |
Tablets and phones with an attached keyboard may send a different modifier key (the one you hold alongside the letter), so check which one it sends before you count on Command or Ctrl.
How to access undo from the menu
When you forget the keys, or you’re in an app you’ve never opened, the Edit menu is your backup:
- Open the Edit menu.
- Click Undo, which sits first in the list.
Most apps print each command’s shortcut beside it, so to find the keys for anything, read the menu. The menu is a backup, not a habit: learn the key there, then let your fingers take over.

Shortcuts that pair well with undo
Undo works best next to the moves that cause the mistakes it fixes. Copy and paste are the obvious pair:
- Copy and paste. Ctrl+C and Ctrl+V (Command+C and Command+V on a Mac) move text fast, and Ctrl+Z reverses a paste that lands in the wrong place.
- Chain them for speed. Copy, paste, undo, and paste again, all without lifting your hands.
Think of a bookkeeper working from a kitchen table who pastes a row of figures into the wrong month. One Ctrl+Z clears it, and the correct paste takes a second. It’s less about memorizing twenty keys and more about chaining the few you use daily.
No mouse, no lost place in the spreadsheet.
Using Redo and Shortcuts Across Apps
Redo is undo’s counterpart, and how it behaves depends on the app you’re in.
How redo brings edits back
Redo reverses an undo, moving you forward to the more recent state of your work. Undo steps back, and redo steps forward again. The catch is the redo list: steps you’ve undone and can still bring back.
A new edit clears that list, so typing after an undo erases the path forward. Some apps use a branching redo model instead, keeping undone paths as branches you can return to.
How redo behaves in popular apps
In most apps, redo is Ctrl+Y or Ctrl+Shift+Z on Windows and Cmd+Shift+Z on a Mac, though exact keys vary. Word and Excel follow the usual pattern. Google Docs and Sheets track their own history inside the page, so redo only reaches edits made there.
Plain browser text fields are less predictable, since each site handles its own input. Photoshop is the exception, so check its documentation first.
Why shortcuts speed up your work
A study of ExposeHK found that keyboard shortcuts beat a pointer for selecting commands. Participants took 26% less time on average with the keyboard (1.87 seconds versus 2.52 seconds).
Think of a home office bookkeeper who bolds totals in a spreadsheet. They press Ctrl+Z to drop a bold change, then decide they liked it after all. One redo brings it back, and their hands never leave the keyboard.
That’s quick error correction, and the win is recovery rather than retyping.
Fewer mouse trips also protect your focus. Hands stay on the keys.
Why is Ctrl+Alt+Arrow not working?
If Ctrl+Alt+Arrow does nothing, don’t assume your keyboard is broken. It isn’t one of the usual redo keys, so we’ll check what your app actually uses. Try these fixes:
- Try the usual keys. Ctrl+Y or Ctrl+Shift+Z on Windows, Cmd+Shift+Z on a Mac.
- Check app documentation. The app’s help pages list its exact redo keys.
- Customize shortcut keys. Many apps let you reassign redo to a combo you can reach.
Some apps lack redo entirely, so retyping is the fallback. Email, chat, and file managers may offer undo for a recent send, delete, or move, though not all do. Check the edit menu once, then learn its shortcut.
How Undo Systems Are Designed
Every undo you press follows a design someone chose on purpose, and knowing the common choices makes undo less mysterious.
Linear and non-linear undo models
Many apps use stack-based linear undo: each action goes on a pile, and undo removes the most recent one. Consider a freelance editor who accidentally deletes a paragraph of a client draft.
One Ctrl+Z (Cmd+Z on a Mac) restores it. Her hands stay on the keys.
A restricted linear model keeps the one-step-at-a-time order but limits which actions you can reverse. Script, US&R, and triadic models are more specialized designs you’ll rarely meet in everyday apps.
Selective undo is the clearest non-linear case: it reverses one earlier change, not the latest one, and keeps everything you did after it.
Properties that shape an undo model
Three properties decide whether an undo model behaves predictably:
- The stable execution property means a command gives the same result each time it runs from the same starting state.
- The minimalistic undo property says undo should reverse what the action changed, not everything around it.
- Commutativity means that when two actions are independent, doing them in either order gives the same result.
So undoing a change in one paragraph won’t disturb an edit elsewhere. Get all three right, and undo feels boring, which is the goal.
Common patterns for building undo
Developers usually build undo around a couple of common patterns. The command pattern wraps each action in an object that knows how to reverse itself. The memento pattern saves a snapshot of the state before a change, so undo restores that snapshot.
The command pattern stores how to reverse each action, while the memento pattern stores what things looked like.
History list management is the bookkeeping behind either approach: tracking past actions, capping how many you keep, and clearing redo steps after a fresh change.

Ways to roll back to earlier states
Rolling back can happen in four main ways:
- Full checkpoint: save a complete copy of the document at set points, then restore the copy.
- Complete rerun: start from the original state and replay every command except the ones you undid.
- Partial checkpoint: save only the parts that changed, which takes less space than a full copy.
- Inverse function: pair each action with a function that reverses it.
Whichever method an app uses, the Ctrl+Z you press looks the same.
The parts that make up undo
Undo is built from four parts:
- Commands: the individual actions, such as typing a word or deleting a row.
- History buffer: the stored record of recent commands, kept in order.
- Undo/redo manager: the component that picks which command to reverse or reapply.
- User interface: the Undo and Redo buttons, menu items, and keyboard shortcuts you actually press.
These four parts explain where a strange undo comes from.
Where Undo Came From
Undo feels so ordinary now that it’s easy to forget someone had to build it first. Its story starts in research labs, long before Ctrl+Z ever reached your keyboard.
Early systems with reversible editing
Some early systems let you back out of changes, a feature called reversible editing. Three early examples:
- FRESS at Brown, 1968
- Teitelman’s Programmer’s Assistant
- Xerox PARC’s Bravo, 1974
In Bravo, the Undo command reversed the effects of the previous command, according to a Bravo course outline. Research went further.
A Communications of the ACM paper on reversible execution noted that backtracking through a program’s execution had gained wider acceptance as a desired feature in programming languages.
How Ctrl+Z and Apple’s Edit menu started
Xerox PARC assigned Ctrl+Z to undo, the same combination many people still press without thinking. Then the story moved to Apple, with Tesler and Atkinson among the names attached to it.
The Macintosh made Undo a standard command in its Edit menu, and the Edit menu guidance in the Macintosh HI Guide said all applications should support Undo, Cut, Copy, Paste, and Clear.
Think of a home office worker who deletes a client’s paragraph by accident. One press of Cmd+Z on a Mac (Ctrl+Z on Windows) brings it back.
When multi-level undo began appearing
In the 1980s, multi-level undo was introduced, letting you step back through more than one change. The shift was less about whether you could undo and more about how far back you could go. Mistakes got cheaper.
Programs in this group include:
- EMACS
- CygnusEd
- AtariWriter
- NewWord.
How the Keploy Tool Helps Testers
Keploy helps testers check how an application programming interface (API) behaves, and it does much of the setup for you. Its job is easy to mix up with undo, so we’ll compare the two.
Comparing automated API testing to redo
Redo brings back the change you just reversed. Keploy works at a different point in the process, because it turns real traffic into something you can check again later. Here’s what that looks like:
- Records API interactions. Keploy captures the requests and responses it sees, so the exchange is saved for later.
- Generates test cases. From those recorded interactions, Keploy builds test cases you can rerun whenever the code changes.
- Compared to redo shortcuts. Redo fixes a mistake you just made, while generated tests help you catch the next one.
Consider a developer working from a home office who changes a login endpoint on a Tuesday afternoon.
Instead of clicking through every screen to confirm nothing broke, she reruns the tests Keploy generated from earlier traffic and sees right away whether login still responds the way it did before. Hands stay on the keys.
Undo is one of the few shortcuts that pays off every single day. Once Ctrl+Z or Cmd+Z feels automatic, you stop bracing for mistakes and start moving faster through your work.
Pair it with redo, a clear plan for when undo stalls, and a keyboard-first desk setup, and fixing errors becomes a quick reflex instead of a detour to the mouse. Your hands stay on the keys, and your work keeps moving.
References
- Further testing the performance of ExposeHK in CommandMaps-like interfaces and a semi-realistic task — doi.org (2025)
- Reversible execution — dl.acm.org
- [cd8]<altodocs>bravocourseoutline1.press!2 — xeroxalto.computerhistory.org
- A temporal model for multi-level undo and redo — doi.org (2000)
- The Edit Menu (HI Guide) — dev.os9.ca
Questions
What is the keyboard shortcut for undo text?
In most Windows and Linux apps, press Ctrl+Z to undo text. On a Mac, press Command+Z.
What is the Ctrl+F4 used for?
Ctrl+F4 usually closes the active document or window within an application. It is different from Ctrl+Z, which undoes the last change.
What are the shortcuts for redo?
Redo is usually Ctrl+Y or Ctrl+Shift+Z on Windows, and Command+Shift+Z on a Mac. Shortcuts can vary by app.
How do I undo an action on my Mac?
Press Command+Z to undo the last action on a Mac. Press it again to step back through earlier changes.
How to access shortcut keys?
Open the app’s Edit menu and look beside a command such as Undo or Redo for its keyboard shortcut. You can also check the app’s help or settings, where some programs let you customize shortcuts.
Why is the Ctrl+Alt+Arrow not working?
Ctrl+Alt+Arrow is not a standard redo shortcut, so the app may not assign it to an action. Try Ctrl+Y or Ctrl+Shift+Z on Windows, check the app’s shortcut list, and confirm that another feature or system setting is not intercepting the key combination.
Sources
- A temporal model for multi-level undo and redo, doi.org,
- Reversible execution | Communications of the ACM, dl.acm.org
- [_cd8_]<altodocs>bravocourseoutline1.press!2, xeroxalto.computerhistory.org
- The Edit Menu (HI Guide), dev.os9.ca
- Further testing the performance of ExposeHK in CommandMaps-like interfaces and a semi-realistic task, doi.org,
spaceShortcut Sheets: the twenty keys to learn first in each appFind your app