The Ctrl+Z shortcut is the universal keyboard command for Undo—it reverses your most recent action in almost every Windows program, from deleting a sentence in Word to removing a formula in Excel. Press it once to undo the last change, and keep pressing it to step further back through your history. On a Mac, the same function uses Command+Z.
Where Did Ctrl+Z Come From?
The keyboard shortcut traces its roots to the early days of personal computing. In the 1980s, IBM and Microsoft standardized common editing commands for the PC keyboard. The letter Z was chosen because it sits at the bottom-left of the QWERTY layout, close to the Ctrl key, making it easy to press with one hand. The concept of “undo” itself was popularized by Xerox PARC’s research in the 1970s, which influenced early word processors like WordStar and later Microsoft Word. The Ctrl key combined with a letter became the standard for commands (Ctrl+C for copy, Ctrl+V for paste), and Ctrl+Z for undo stuck because it was intuitive and memorable.
How Undo Actually Works
When you press Ctrl+Z, the program doesn’t just “reverse” the last action—it consults an undo stack, a list of recorded changes. Each action you perform (typing, deleting, formatting, moving objects) is pushed onto this stack. Pressing Ctrl+Z pops the most recent action off and restores the previous state. Most programs allow multiple undos, but the depth varies:
- Microsoft Word: Default undo limit is 100 actions, but you can change it in Options (Advanced > Editing options > Maximum number of undos).
- Excel: Default undo limit is 100 actions, but this can be increased up to 32767 in Options > Advanced > General > Undo history.
- Adobe Photoshop: Default history states are 50, adjustable in Preferences > Performance.
- Web browsers: Ctrl+Z typically undoes text input in forms, not page navigation.
Important: The undo stack is cleared when you save and close a document, or when you run certain operations like a macro in Excel. Also, some actions are not undoable—for example, saving a file or closing a tab.
How to Choose Between Undo and Redo
After you undo, you might realize you went too far. That’s where Redo comes in. The shortcut is Ctrl+Y on Windows (or Ctrl+Shift+Z in many programs), and Command+Shift+Z on Mac. Redo re-applies the action you just undid, moving forward through the history. In Excel, Ctrl+Y also repeats the last action if you haven’t undone anything—a handy trick for formatting multiple cells. If you undo too many steps, simply press Redo repeatedly to get back to where you were.
Common Problems and Fixes
Sometimes Ctrl+Z doesn’t work as expected. Here are typical issues and solutions:
- It only undoes one step: Some programs, like older versions of Notepad, only support a single undo. Upgrade to Notepad++ or use a modern editor.
- It undoes the wrong thing: If you have multiple windows open, Ctrl+Z only affects the active window. Make sure the correct document has focus.
- It does nothing: Check if the action is undoable (e.g., saving a file isn’t). Also, some web apps like Google Docs have their own undo history that may conflict with browser shortcuts.
- It undoes in the wrong order: In Excel, if you run a macro, the entire macro is treated as one action, so Ctrl+Z undoes the whole macro, not individual steps.
Ctrl+Z in Different Applications
While the basic function is universal, there are nuances:
- Microsoft Excel: Undo works for cell edits, formatting, and most commands. However, it does not undo changes made by VBA macros (unless you use
Application.Undoin the macro). Also, deleting a sheet cannot be undone. - Microsoft Word: Undo covers typing, formatting, and even some file operations like inserting a picture. But it does not undo “Save” or “Print”.
- Adobe Photoshop: Ctrl+Z is a single undo by default. To step back multiple times, use Ctrl+Alt+Z (Windows) or Command+Option+Z (Mac).
- Web browsers: In Chrome or Edge, Ctrl+Z undoes text input in forms, but not closing a tab. To reopen a closed tab, use Ctrl+Shift+T.
- File Explorer: Ctrl+Z undoes the last file operation, like renaming, deleting, or moving a file. This is a lifesaver if you accidentally delete a file—but be careful: it only works if the file is still in the Recycle Bin (or not permanently deleted).
Alternatives to Ctrl+Z
If you prefer the mouse or need more control, there are alternatives:
- Toolbar buttons: Most programs have an Undo arrow (usually a curved arrow pointing left) in the Quick Access Toolbar or Ribbon. In Excel, you can click the dropdown arrow next to the Undo button to see a list of recent actions and undo several at once.
- Right-click menu: In many text fields, right-clicking gives an “Undo” option.
- Version history: For files, use “File > Info > Version History” in Office to restore an earlier version, which is more powerful than undo for long-term changes.
- File recovery: If you close without saving, Excel and Word have “Recover Unsaved Workbooks/Documents” under File > Info.
Safety and Limitations
Undo is not a safety net for everything. Here’s what you need to know:
- Non-undoable actions: Saving, printing, closing a document, and deleting a sheet in Excel are typically irreversible. Always save a backup copy before making major changes.
- Macros: In Excel, running a macro that changes data cannot be undone with Ctrl+Z unless the macro includes
Application.Undoat the end. Always save a copy of your workbook before running a macro—macros cannot be undone with Ctrl+Z. - Permanent deletion: In File Explorer, if you delete a file with Shift+Delete (bypassing the Recycle Bin), Ctrl+Z will not bring it back. Use file recovery software as a last resort.
- Data loss in web apps: Some online editors may not support undo after a page refresh. Save frequently.
Frequently Asked Questions
Can I undo more than one step at a time? Yes, in most programs. Press Ctrl+Z repeatedly to undo multiple steps, or in Excel, click the dropdown arrow next to the Undo button to select a batch of actions to undo at once. The number of steps you can undo depends on the program’s undo history limit.
What is the difference between Ctrl+Z and Ctrl+Y? Ctrl+Z undoes your last action, while Ctrl+Y redoes an action you just undid. In Excel, Ctrl+Y also repeats the last action if you haven’t undone anything—useful for applying the same formatting to multiple cells.
Why doesn’t Ctrl+Z work in my browser? In web browsers, Ctrl+Z only works in text fields (like search boxes or comment forms). It does not undo closing a tab or navigating to a previous page. For those, use Ctrl+Shift+T to reopen a closed tab, and Alt+Left Arrow to go back.
Can I increase the number of undos in Excel? Yes. Go to File > Options > Advanced, scroll to the “General” section, and set the “Undo history” to a number up to 32767. Note that a very high limit may use more memory.
Does Ctrl+Z work after saving a file? Usually, yes—saving does not clear the undo stack in most programs. However, if you close and reopen the file, the undo history is lost. In Excel, you can still undo after saving, but not after closing.
What if I accidentally undo something and then save? If you save after undoing, the undo action is permanent—the redo history is cleared when you save in some programs. To avoid this, use “Save As” to keep a version before undoing, or use Version History in Office to recover an earlier state.
Related
- Shortcut for Shutdown? The Real Windows Way
- Entry Level Data Entry Clerk: Job, Pay & Skills
- Google Sheets Query Concatenate Columns
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Name a Dropdown List in Excel with a Named RangeTo name a dropdown list in Excel, give its source cells a name, then use that name as…
- Dynamic Checklist in Excel: Build One That UpdatesTo make a dynamic checklist in Excel, put task names and completion checkboxes in an Excel table, then…
- Find and Replace Highlight Color in Microsoft WordIn Word for Microsoft 365 on Windows, use Home > Find, then search for the Highlight format and…
- How to Create a Mail Merge Letter in Microsoft WordTo create a mail merge letter in Word, prepare a recipient list, connect it to a letter, insert…
- How to Make a Monthly Budget Planner in Google SheetsTo make a monthly budget planner in Google Sheets, create one tab for your budget and another for…
- How to Insert a New Line in an Excel Cell on Windows and MacTo insert a new line inside an Excel cell, edit the cell, place the cursor where the break…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.