The desktop undo shortcut is Ctrl+Z on Windows and Command+Z on macOS. Pressing it reverses the most recent action you performed on the desktop, such as renaming, moving, deleting, or creating a file or folder. This works in File Explorer (Windows) and Finder (Mac) as well as on the desktop itself.
How Desktop Undo Works
When you press Ctrl+Z on the desktop, the operating system maintains a short history of file operations. This history is stored in memory and persists until you perform a new action, restart the computer, or run out of the allocated undo stack. The undo command reverses actions in reverse chronological order: the last action is undone first, then the one before that, and so on. For example, if you rename a file and then move it to a different folder, pressing Ctrl+Z once undoes the move, and pressing it again undoes the rename.
This is not the same as the Recycle Bin. Undo restores the file to its exact previous state and location, whereas the Recycle Bin only holds deleted files. If you delete a file and then press Ctrl+Z, the file returns to its original spot without ever appearing in the Recycle Bin. If you empty the Recycle Bin, Ctrl+Z will not bring the file back because that action is not part of the desktop undo history.
What Actions Can Be Undone
The undo shortcut covers most file management actions, but not every possible change. Common undoable actions include:
- Renaming a file or folder
- Moving a file or folder to a different location
- Deleting a file or folder (sends it back to its original location)
- Creating a new folder or shortcut
- Copying and pasting a file onto the desktop
- Changing file properties like read-only status or hidden attribute
Actions that cannot be undone with Ctrl+Z include permanently deleting a file with Shift+Delete (unless you have a third-party recovery tool), changing the desktop wallpaper, or rearranging icons manually. Icon arrangement is not tracked by the undo system.
Redo: The Opposite Direction
If you undo too many steps, you can redo them. The redo shortcut is Ctrl+Y on Windows and Shift+Command+Z on macOS. Redo reverses the last undo, so it reapplies the action you just cancelled. For instance, if you accidentally undo a file move, pressing Ctrl+Y will move it back. Redo only works immediately after an undo; if you perform a new action, the redo history is cleared.
Some applications also use Ctrl+Shift+Z for redo, but on the desktop and in File Explorer, Ctrl+Y is the standard. In Finder on Mac, the menu shows “Redo” with the shortcut Shift+Command+Z, but Command+Shift+Z is also accepted.
Using Undo in File Explorer and Finder
The same shortcut works inside File Explorer (Windows) and Finder (Mac), not just on the bare desktop. If you are inside a folder and you rename a file, press Ctrl+Z to undo the rename. If you move a file from one folder to another via cut and paste, Ctrl+Z will cancel the move and return the file to its source folder. The undo history is shared between the desktop and open Explorer/Finder windows, so an action taken in one place can be undone while you are in another.
One limitation: the undo history is per-session. If you close File Explorer and reopen it, the history is cleared. The same applies to Finder. Restarting the computer also clears the history, so you cannot undo actions from a previous session.
Common Problems and Misconceptions
A frequent misconception is that Ctrl+Z can undo a file that was permanently deleted with Shift+Delete. It cannot. The undo history does not track permanent deletions. Another issue is that the undo shortcut may appear to do nothing if you have just changed the desktop background or arranged icons; those actions are not part of the file operation history.
Sometimes users press Ctrl+Z and expect it to undo a file overwrite. If you copy a file with the same name into a folder and choose “Replace,” the original file is overwritten, and Ctrl+Z will not restore it. Windows does not keep a backup of the overwritten file in the undo history. You would need a file recovery tool or a previous version from File History to get it back.
Another problem: the undo history is limited in size. Windows typically stores a few dozen actions, but the exact number depends on available memory. If you perform many actions in a row, older ones are dropped from the history, so you cannot undo beyond that point.
Keyboard Shortcuts on Different Systems
Windows 10 and Windows 11 both use Ctrl+Z for undo and Ctrl+Y for redo. MacOS uses Command+Z for undo and Shift+Command+Z for redo. On Linux desktops like GNOME or KDE, Ctrl+Z and Ctrl+Shift+Z are common, but the exact behavior depends on the file manager (Nautilus, Dolphin, etc.). Most Linux file managers support undo for file operations, but the shortcut may vary; check the Edit menu for the exact key combination.
If you are using a remote desktop or a virtual machine, the shortcut may be intercepted by the host system. In that case, you may need to use the on-screen menu or the Edit > Undo option in the file manager.
Alternatives to Keyboard Shortcuts
If you prefer not to use the keyboard, you can use the right-click context menu. Right-click on the desktop or inside a folder and look for “Undo” at the top of the menu. The menu item shows the action that will be undone, such as “Undo Rename” or “Undo Delete.” Clicking it performs the same operation as Ctrl+Z.
In File Explorer, you can also find Undo in the Home tab of the ribbon, under the “Undo” button. In Finder, the Edit menu at the top of the screen has Undo and Redo options. These menu-based methods are useful if the keyboard shortcut is not working or if you want to see exactly what action will be undone before committing.
Frequently Asked Questions
Does Ctrl+Z work after emptying the Recycle Bin?
No. Emptying the Recycle Bin is a permanent action that is not tracked by the undo history. Once the bin is emptied, the files are gone from the file system, and Ctrl+Z will not restore them. You would need third-party data recovery software, and success is not guaranteed.
Can I undo a file copy that replaced an existing file?
No. When you copy a file over an existing one with the same name and choose “Replace,” the original file is overwritten. The undo history does not contain a backup of the overwritten file. To avoid this, use the “Skip” option or rename the new file before copying.
Why does Ctrl+Z sometimes undo something I did in a different program?
It doesn’t. The desktop undo shortcut only affects file operations in File Explorer or Finder. If you are typing in a text editor, Ctrl+Z undoes text changes in that program, not desktop actions. The shortcut is context-sensitive; it works on whichever window has focus.
How many steps can I undo on the desktop?
There is no fixed number. Windows and macOS store a dynamic history based on available memory, typically between 10 and 50 actions. Once the history is full, the oldest actions are discarded. You cannot undo an action that has been dropped from the history.
Is there a way to undo a permanent delete (Shift+Delete)?
No, not with the undo shortcut. Shift+Delete bypasses the Recycle Bin, and the action is not recorded in the undo history. You would need a file recovery tool that scans the disk for deleted data, and you should stop using the drive immediately to avoid overwriting the deleted file.
Does the undo shortcut work on network drives or cloud folders?
Generally, yes, but it depends on the file system. For network drives, the undo action may be limited to renaming or moving, and it may not work if the network connection is slow. For cloud folders like OneDrive or Dropbox, the undo works locally, but the change may sync to the cloud before you can undo it, which could cause a conflict.
Related
- Google Sheets Savings Tracker: Setup & Use
- Control S Shortcut? What It Does and How to Use It
- Data Entry Jobs for College Students: Real Guide
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Print: Keep Row and Column Headers on Every PageTo keep a heading row on every printed page in Excel for Microsoft 365 on Windows, select the…
- How to Insert Alternating Color Rows in Excel EasilyTo insert alternating color rows in Excel, select your data, choose Home > Format as Table, pick a…
- How to Copy an Excel Spreadsheet SafelyTo copy an Excel spreadsheet, choose what you need to duplicate: a worksheet, a selected range of cells,…
- How to Add Footnotes in Word: Desktop and WebTo add a footnote in Microsoft Word, click where its number should appear, choose References > Insert Footnote,…
- Multiple Goal Seek in Excel: What Works and What Doesn’tExcel’s Goal Seek can solve for one changing cell to make one formula reach one target per run;…
- Chapter 8 Traffic Signs: Meanings & RulesChapter 8 of the Manual on Uniform Traffic Control Devices (MUTCD) covers traffic control devices for railroad and…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.