How to Undo and Redo with Ctrl+Z and Ctrl+Y
In this article
Yes, pressing Ctrl+Z undoes your last action, and Ctrl+Y redoes it (or Ctrl+Shift+Z on some programs). These shortcuts work in most text editors, office suites, image editors, and even file managers. No special setup is needed—they are built into Windows, macOS (where you use Cmd instead of Ctrl), and most Linux desktop environments. This guide covers the basics, variations, and fixes when they stop working.
What You'll Need
- A keyboard with Ctrl (Windows/Linux) or Cmd (Mac) and the letter Z/Y keys.
- An application that supports undo/redo (most do—Word, Excel, Notepad, Photoshop, Google Docs, file explorers, etc.).
- No installation or configuration required.
Step-by-Step
- Perform an action you want to reverse—type a word, delete a file, format some text, or move an object. The undo history captures most changes.
- Press Ctrl+Z (or Cmd+Z on Mac) to undo the most recent action. Each press undoes one more step, going backward in time.
- To redo what you just undid, press Ctrl+Y (or Cmd+Shift+Z on Mac, or Ctrl+Shift+Z in many Linux apps). This restores the action you undid, moving forward again.
- Repeat Ctrl+Y to redo multiple steps, matching the number of undos you did.
- If Ctrl+Y does nothing, try Ctrl+Shift+Z—some programs (like Adobe Photoshop, GIMP, and many Linux apps) use this instead.
- Use the menu as an alternative: look for an Edit menu at the top of the window, then click Undo or Redo. The menu often shows the keyboard shortcut next to it.
- For file operations (like renaming or deleting in Windows Explorer or macOS Finder), Ctrl+Z works to undo the last file action. Redo with Ctrl+Y in Windows Explorer; on Mac Finder, use Cmd+Shift+Z.
Note: The exact labels and shortcuts can vary slightly by application version, operating system, or region. When in doubt, check the Edit menu or the app's Help section.
Common Mistakes
- Pressing Ctrl+Y when you meant Ctrl+Z—they are adjacent, so it's easy to mix up. Ctrl+Z is always undo; Ctrl+Y is redo (on Windows/Linux).
- Using Ctrl+Shift+Z on Windows expecting redo—this works in some apps but not all. Stick with Ctrl+Y for Windows unless you know the app uses the other.
- Assuming undo works after you save and close—once you close the document, the undo history is usually lost. Save often, but undo only works within the current session.
- Undoing too many times—if you press Ctrl+Z past the point you wanted, you'll lose more than intended. Use Ctrl+Y to step forward again.
- Forgetting that some actions are not undoable—for example, saving a file, sending an email, or printing cannot be undone with Ctrl+Z.
Tips
- Learn the Mac equivalent: On macOS, use Cmd+Z for undo and Cmd+Shift+Z for redo. Some Mac apps also accept Cmd+Y, but it's less common.
- Use the toolbar: Many apps have circular arrow buttons for undo (left-pointing) and redo (right-pointing). Clicking them works the same as the keyboard shortcut.
- Check the undo history: Some advanced apps (like Photoshop) have a History panel that lists every step. You can click any step to jump directly to that state, which is faster than pressing Ctrl+Z many times.
- In text fields, Ctrl+Z works in almost any input box—browser address bars, search fields, chat boxes—so you can quickly fix typos.
- For file deletions, Ctrl+Z in Windows Explorer or macOS Finder can restore a deleted file to its original location, saving you from the Recycle Bin/Trash.
Troubleshooting
If Ctrl+Z or Ctrl+Y isn't working, try these in order:
- Check if the app is focused—click inside the document or text field first. Keyboard shortcuts only work when the correct window is active.
- Look for the Edit menu—if Undo is grayed out, there's nothing to undo. Perform a new action (like typing a letter) and try again.
- Try the alternative shortcut—if Ctrl+Y doesn't redo, press Ctrl+Shift+Z. If that fails, use the Edit menu's Redo option.
- Restart the application—sometimes the undo history gets corrupted or the app stops responding to shortcuts. Save your work, close the app, and reopen it.
- Check for keyboard issues—test Ctrl+Z in a simple text editor (like Notepad). If it doesn't work there, your keyboard may have a stuck key or driver issue. Try a different keyboard or use the on-screen keyboard (Windows: Win+Ctrl+O; Mac: System Settings > Keyboard > Show Keyboard Viewer).
- Update the application—older versions may have bugs. Install the latest update from the official website or app store.
- If nothing works, manually revert your changes: re-type the text, re-apply formatting, or restore the file from the Recycle Bin/Trash. For documents, check if your app has an autosave or version history feature (like Google Docs' version history or Microsoft Word's Version History).
Frequently Asked Questions
Why does Ctrl+Y not work in some programs?
Some programs use Ctrl+Shift+Z for redo instead, especially on Mac and Linux. Check the Edit menu to see what shortcut is listed next to Redo.
Can I undo after saving the file?
In most desktop apps, no—saving clears the undo history. However, some cloud-based apps (like Google Docs) keep a version history that lets you revert to earlier versions even after saving.
How many times can I press Ctrl+Z?
It depends on the app. Most keep a limited number of steps (often 20–100). Once you exceed that, the oldest actions are forgotten.
Does Ctrl+Z work in the file explorer?
Yes, in Windows Explorer and macOS Finder, Ctrl+Z (or Cmd+Z) can undo file operations like rename, delete, move, or copy. Redo works with Ctrl+Y on Windows and Cmd+Shift+Z on Mac.
What is the difference between Ctrl+Y and Ctrl+Shift+Z?
They are both redo shortcuts, but different apps use one or the other. On Windows, Ctrl+Y is standard; on Mac and many Linux apps, Ctrl+Shift+Z (or Cmd+Shift+Z) is the norm.
Can I redo after closing and reopening the app?
No, the undo/redo history is stored in memory and is lost when the app closes. You'll need to manually redo any changes after reopening.