The fastest way to undo is Ctrl+Z on Windows or Command+Z on Mac
Pressing Ctrl+Z (Windows) or Command+Z (Mac) will undo your last action in almost every program on your computer. This works in word processors, spreadsheets, photo editors, email, web browsers, and most other software. The shortcut works the same way across different programs, so once you learn it, you can use it everywhere.
If you need to undo more than one action, keep pressing the same keys repeatedly. Each press takes you back one step further. Most programs let you undo dozens or even hundreds of actions, though some limit how far back you can go. The undo history usually clears when you close the program.
If you undo something and then change your mind, you can redo it by pressing Ctrl+Y (Windows) or Command+Y (Mac). Some Mac programs use Command+Shift+Z for redo instead, so check your program's menu if the Y shortcut does not work.
Key Takeaways
- Ctrl+Z on Windows and Command+Z on Mac will undo your last action in nearly every program.
- You can press the undo shortcut multiple times in a row to step back through several actions.
- Redo your action with Ctrl+Y (Windows) or Command+Y (Mac) if you undo by mistake.
- If the keyboard shortcut does not work, look in the Edit menu at the top of the window for an Undo option.
- Closing the program without saving will erase your undo history, so undo only works while the program is still open.
Using the Edit menu when the keyboard shortcut does not work
If Ctrl+Z or Command+Z does not work in a particular program, open the Edit menu at the top of the window. The first or second option is usually labeled "Undo" followed by a description of what will be undone — for example, "Undo Typing" or "Undo Delete". Click that option to undo your last action.
The same menu will show you a "Redo" option below the Undo option. Some programs also show a small arrow next to Undo that lets you see a list of recent actions and jump back to any of them at once, rather than undoing one step at a time.
Web browsers like Chrome, Firefox, and Safari all support Ctrl+Z or Command+Z, but they undo actions within the page you are viewing — not your browsing history. If you accidentally close a tab, use Ctrl+Shift+T (Windows) or Command+Shift+T (Mac) to reopen it instead.
When undo does not work or is grayed out
If the Undo option in the Edit menu appears grayed out or disabled, it means there is nothing left to undo. This happens when you have already undone all the way back to the point where you opened the file, or when the program does not track changes for that particular action.
Some actions cannot be undone, such as saving a file, closing a program, or deleting a file from your computer permanently. If you delete a file and want it back, check your Recycle Bin (Windows) or Trash (Mac) instead — those are separate from the undo function.
If you made changes and then saved the file, undo will only work back to the last save point. Changes you made before saving are gone once you close the file. To avoid losing work, save your file regularly while you are working, and use undo only for recent changes.
Undo in specific programs: Word, Excel, and Sheets
Microsoft Word, Excel, and Google Sheets all use Ctrl+Z (Windows) or Command+Z (Mac) to undo. In Word, you can undo typing, formatting, deletions, and most other edits. In Excel and Sheets, you can undo cell entries, formula changes, and formatting.
Word and Excel show an undo button in the toolbar at the top — it looks like a curved arrow pointing left. Click it once to undo, or click the small arrow next to it to see a list of recent actions and jump back to any point. Google Sheets has the same button in the toolbar, labeled with a left-pointing arrow.
One important difference: in Google Sheets, if someone else is editing the same spreadsheet at the same time as you, undo only affects your own changes, not theirs. In Word and Excel on your own computer, undo affects all changes in the file.
Undo in photo and design programs
Photo editors like Photoshop, GIMP, and Photopea all use Ctrl+Z or Command+Z to undo. However, these programs often work differently than word processors. In Photoshop, pressing Ctrl+Z once toggles between your last two states — press it again to toggle back. To step through multiple changes one at a time, use Ctrl+Alt+Z (Windows) or Command+Option+Z (Mac) instead.
GIMP and Photopea use Ctrl+Z to step back one action at a time, the same as Word. Check your program's Edit menu if you are unsure which behavior yours uses. Design programs like Figma and Canva also support Ctrl+Z or Command+Z for undo.
Photo programs often use a lot of memory when you undo many steps, especially with large images. If your program slows down after undoing many times, you may have hit the limit of how many undo steps the program will store. Closing and reopening the file will clear the undo history and free up memory.
Undo on your phone or tablet
Phones and tablets do not have a Ctrl+Z key, so undo works differently. On iPhone and iPad, shake your device gently to bring up an undo prompt, then tap "Undo" to reverse your last action. This works in many Apple apps like Notes, Mail, and Pages.
On Android phones and tablets, most apps do not have a built-in undo gesture. Instead, look for an undo button in the app itself — usually a curved arrow icon in the toolbar or menu. Some apps like Google Docs and Google Sheets have an undo button at the top of the screen.
If your phone app does not show an undo button or option, check the app's settings or help section. Not all mobile apps support undo, especially straightforward ones like calculators or note-taking apps.
Undo in web browsers and online documents
Google Docs, Google Sheets, and Microsoft 365 (Word, Excel, PowerPoint online) all support Ctrl+Z or Command+Z to undo. These programs also show your full edit history, which you can access separately from the undo function. In Google Docs, click "File" then "Version history" to see every change made to the document and when.
In Microsoft 365 online, click the undo button in the toolbar or use the keyboard shortcut. The program automatically saves your work, so you do not have to worry about losing changes if you close the browser.
If you are working in a web-based program that does not support undo, try Ctrl+Z anyway — many do support it even if it is not obvious. If that does not work, check the program's menu or help section for an undo option.
Frequently Asked Questions
Can I undo after I close and reopen a file?
No. Once you close a program, the undo history is erased. If you reopen the file, you can only undo changes made since you reopened it. To protect your work, save your file regularly and use undo only while the file is still open in the program.
What is the difference between undo and redo?
Undo reverses your last action. Redo puts it back. If you undo something by mistake, press Ctrl+Y (Windows) or Command+Y (Mac) to redo it. You can only redo actions you just undid — once you make a new change, the redo history is cleared.
Why does undo sometimes not work in my browser?
Some websites do not support undo because they are not designed to track changes the way desktop programs do. If you are typing in a text box on a website and undo does not work, try refreshing the page — but be aware that refreshing will erase any unsaved text you typed.
Can I undo a file deletion?
Undo does not work for file deletions. Instead, open your Recycle Bin (Windows) or Trash (Mac) and look for the file there. If you find it, right-click and choose "Restore" to put it back where it was. If the Recycle Bin or Trash is empty, the file is permanently gone.
How many times can I undo?
Most programs let you undo dozens or hundreds of actions, but the exact number depends on the program and how much memory your computer has. Word and Excel typically store 100 undo steps by default. Photo editors may store fewer steps if you are working with large files. Check your program's settings or preferences if you need to change the undo limit.