Ctrl+Z (Undo Shortcut) — Complete Guide for Every Platform

Ctrl+Z (Undo Shortcut) — Complete Guide for Every Platform
Quick Answer

Ctrl+Z (Windows and Linux) or Cmd+Z (Mac) undoes your last action. Press it multiple times to step back through your undo history. To redo — reverse an undo — press Ctrl+Y on Windows/Linux, or Cmd+Shift+Z on Mac. The shortcut works in Word, Excel, Photoshop, Chrome, File Explorer, VS Code, and most other apps.

Few keyboard shortcuts are as universally loved as Ctrl+Z. Whether you just deleted a paragraph you needed, accidentally moved a file, or made a wrong edit in Photoshop, Ctrl+Z is your instant safety net. It has been built into nearly every operating system and application since the 1980s — yet most people only know half of what it can do.

This guide covers everything: the correct shortcut on every platform, how undo works per application, how to use it to recover deleted files, undo sent emails, undo Git commits, and what to do when Ctrl+Z is not enough.

1984
Year Ctrl+Z undo was standardized on Mac
100+
Undo steps in Excel (default)
Unlimited
Undo history in Photoshop CC 2019+

Ctrl+Z on Every Platform

The undo shortcut is nearly universal, but the exact key combination differs by operating system.

Windows

Ctrl+Z to Undo — Ctrl+Y to Redo

On Windows, Ctrl+Z is the standard undo shortcut in virtually every application — from Notepad and Word to File Explorer and Photoshop. Press it once to undo the last action, press it again to undo the action before that, and so on.

  • Undo: Ctrl+Z
  • Redo (primary): Ctrl+Y
  • Redo (alternate, many apps): Ctrl+Shift+Z
  • Works in File Explorer, browsers, text editors, design tools, and more

Mac

Cmd+Z to Undo — Cmd+Shift+Z to Redo

macOS uses the Command (⌘) key in place of Ctrl. The undo shortcut is Cmd+Z and it works identically across Finder, Pages, Keynote, Safari, Chrome, Photoshop, and nearly every Mac app.

  • Undo: Cmd+Z
  • Redo: Cmd+Shift+Z
  • Cmd+Y is NOT used for redo on Mac (it is the "Show History" shortcut in Safari)
  • In some Apple apps (Finder, TextEdit), undo also works on file renames and moves

Linux

Same as Windows

On Linux desktop environments (GNOME, KDE, XFCE), the undo shortcut follows the Windows convention: Ctrl+Z to undo and Ctrl+Y or Ctrl+Shift+Z to redo. This applies in LibreOffice, GIMP, Nautilus (Files), gedit, and most GTK/Qt applications.

  • Undo: Ctrl+Z
  • Redo: Ctrl+Y or Ctrl+Shift+Z
  • In the Linux terminal, Ctrl+Z suspends the current foreground process (different behavior — see note below)
Linux Terminal Warning: In a bash/zsh terminal, Ctrl+Z does NOT undo — it sends a SIGTSTP signal that suspends the running process and returns you to the shell prompt. To bring it back, type fg (foreground). This only applies inside a terminal window, not in graphical desktop applications.

Browser Text Fields and Web Apps

In most web browsers (Chrome, Firefox, Edge, Safari), Ctrl+Z works inside text input fields and <textarea> elements, letting you undo typing. Support varies between web applications — single-page apps that manage their own state (like Figma or Google Docs) implement undo internally and often support deep undo histories.

Mobile: Undo Without a Keyboard

There is no Ctrl+Z on a phone, but undo is still possible:

Undo Limits by Application

Not all undo stacks are created equal. Each application manages its own undo history independently. Here is a breakdown of the most common apps:

Application Default Undo Limit Can Be Changed? Notes
Microsoft Word Unlimited (session) No Ctrl+Y also re-applies the last action
Microsoft Excel 100 steps Via registry (Windows) Max 100; lowering saves memory on large workbooks
Adobe Photoshop CC 2019+ Unlimited Yes — Preferences → Performance → History States More history = more RAM usage; capped at 1,000 states
Adobe Photoshop CS6 and earlier 20 steps Yes (Preferences) Ctrl+Z toggled between last two states only
Google Chrome (text fields) Browser-managed No Works in address bar and form fields
VS Code Unlimited (session) Yes — editor.undoLimit setting Per-file undo history, cleared on file close
File Explorer (Windows) ~10–15 steps No Undoes moves, renames, and deletions to Recycle Bin
Notepad (Windows 11) Unlimited No Windows 11 Notepad added unlimited undo; legacy Notepad: 1 step
LibreOffice Writer 100 steps Yes — Tools → Options → LibreOffice → Memory Configurable from 1 to 1,000 steps
Gmail (compose) In-session typing No Ctrl+Z undoes typing; separate "Undo Send" for sent emails

Undo Deleted Files with Ctrl+Z in File Explorer

One of the most underused features of Ctrl+Z is its ability to recover files you just deleted, moved, or renamed in Windows File Explorer — without needing to open the Recycle Bin.

1

Delete, Move, or Rename a File in File Explorer

You accidentally deleted a file (it went to the Recycle Bin), moved it to the wrong folder, or renamed it incorrectly. The window is still open.

2

Press Ctrl+Z Immediately

While the File Explorer window is in focus, press Ctrl+Z. The file instantly returns to its original location, its original name is restored, or it reappears from the Recycle Bin — whichever action you undid.

3

Press Multiple Times for Multiple Operations

You can keep pressing Ctrl+Z to step back through several file operations. File Explorer remembers around 10–15 recent file actions in a session. To redo (put the file back where you moved it), press Ctrl+Y.

Pro tip: Ctrl+Z in File Explorer works for moves, renames, copies, and deletions to the Recycle Bin. It does NOT work for files that were permanently deleted (Shift+Delete bypasses the Recycle Bin). If you permanently deleted a file, you need dedicated recovery software — or call IT Cares.

Accidentally Deleted Something Important?

IT Cares recovers deleted files and restores accidental changes — flat rate of $59. No fix, no charge.

Undo a Sent Email in Gmail

Gmail does not let you un-send a message with Ctrl+Z, but it has a dedicated "Undo Send" feature that works during a brief window after clicking Send. You need to enable it first.

1

Enable Undo Send in Gmail Settings

In Gmail, click the gear icon → See all settingsGeneral tab. Find "Undo Send" and set the cancellation period to 5, 10, 20, or 30 seconds. Click Save Changes. You only need to do this once.

2

Click "Undo" in the Confirmation Banner

After clicking Send, a black banner appears at the bottom of the screen reading "Message sent" with an Undo link. Click it within your configured time window (up to 30 seconds). The email is pulled back and reopened as a draft.

Important: Once the Undo window expires, the email is delivered and cannot be recalled. Gmail's Undo Send works by delaying the actual send by the configured number of seconds — it is not true recall. For enterprise Microsoft 365 accounts, Outlook has a separate "Recall This Message" feature, though it is unreliable for external recipients.

Undo in Photoshop: History Panel and Limits

Adobe Photoshop has one of the most powerful undo systems of any creative application, but it changed significantly between versions.

Photoshop CC 2019 and Later (Recommended)

Starting with Photoshop CC 2019, Ctrl+Z (Windows) or Cmd+Z (Mac) steps backward through an unlimited history by default. Each press undoes one action. Ctrl+Shift+Z / Cmd+Shift+Z steps forward (redo).

You can increase or decrease the number of saved history states under Edit → Preferences → Performance → History States (1–1,000). More states consume more RAM.

Photoshop CS6 and Earlier

In older Photoshop versions, Ctrl+Z only toggled between the current state and the immediately previous one — pressing it twice returned you to where you started. To step backward multiple times, you had to use Ctrl+Alt+Z. This was a major source of confusion for users switching from other apps.

Using the History Panel

The History panel (Window → History) shows a visual list of every recent action. You can click any state in the list to jump directly to that point — bypassing the need to press Ctrl+Z dozens of times. You can also create a Snapshot of the current state as a named bookmark before making risky edits.

Photoshop undo tip: If Ctrl+Z seems to only toggle between two states, you are likely on an older version or the shortcut was remapped. Go to Edit → Keyboard Shortcuts and verify that "Undo/Redo" is assigned to Ctrl+Z and "Step Backward" is assigned to Ctrl+Alt+Z (or update to CC 2019+).

Undo Git Commits

In Git, there is no Ctrl+Z — but there are several commands that serve the same purpose, depending on how far back you want to go and whether changes have been pushed to a remote.

Undo the Last Commit (Keep Changes in Working Directory)

git reset --soft HEAD~1

This undoes the last commit but keeps all the changed files staged and ready to re-commit. Nothing is lost — you just "unpacked" the commit back into your working tree.

Undo the Last Commit (Discard Changes Completely)

git reset --hard HEAD~1

This removes the last commit AND discards all the changes from that commit. Use with caution — the changes are gone from your local working directory. Not recommended unless you are certain you do not need those changes.

Recover a Commit You Thought Was Gone (git reflog)

git reflog

Git keeps a log of every HEAD movement for 90 days by default. If you accidentally reset too far, find the commit hash in the reflog output and restore it:

git reset --hard <commit-hash>

Undo a Pushed Commit (Safe Method)

git revert <commit-hash>

git revert creates a new commit that undoes the changes from the specified commit without rewriting history. This is the safe way to undo changes that have already been pushed to a shared remote repository.

Never use git reset --hard on shared branches that other team members have already pulled from. It rewrites history and forces others to resolve conflicts. Use git revert instead.

Why Ctrl+Z Sometimes Does Not Work

There are several reasons the undo shortcut may fail or appear to do nothing:

Increase Undo Limit in Excel

Excel's default undo limit is 100 steps. If you need more (or want to reduce it to save memory on large spreadsheets), you can change it in the Windows Registry:

1

Open Registry Editor

Press Win+R, type regedit, and press Enter. Navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\Excel\Options

2

Create or Edit the UndoHistory Value

Right-click in the right pane → New → DWORD (32-bit) Value. Name it UndoHistory. Double-click it, select Decimal, and enter a value between 1 and 100. Click OK and restart Excel.

Caution: Editing the Registry carries risk. If you are not comfortable with this, consider keeping a backup copy of important spreadsheets with regular Save As versions instead of increasing the undo limit.

The Redo Shortcut: Reversing an Undo

If you pressed Ctrl+Z one too many times, redo restores what was undone. The shortcut varies:

Platform / App Redo Shortcut Notes
Windows (most apps) Ctrl+Y Primary redo shortcut
Windows (alternate) Ctrl+Shift+Z Supported in Chrome, VS Code, many apps
Mac (all apps) Cmd+Shift+Z Standard on macOS; Cmd+Y is NOT redo on Mac
Linux (most apps) Ctrl+Y or Ctrl+Shift+Z Both widely supported
Microsoft Word Ctrl+Y Also re-applies last action if nothing was undone
Adobe Photoshop CC 2019+ Ctrl+Shift+Z (Win) / Cmd+Shift+Z (Mac) Steps forward through history

When Ctrl+Z Is Not Enough: Professional File Recovery

Ctrl+Z is powerful but has clear limits. If you have permanently deleted a file, experienced a drive failure, an accidental format, or a ransomware attack, the undo shortcut cannot help — you need professional data recovery.

IT Cares specializes in recovering data in exactly these situations:

Deleted Something That Ctrl+Z Can't Recover?

IT Cares recovers deleted files and restores accidental changes remotely across Canada. Flat rate from $59. No recovery, no charge.

Frequently Asked Questions

How many times can I press Ctrl+Z?

It depends on the application. Most modern apps (Word, VS Code, browsers) support unlimited or very high undo levels within a session. Excel defaults to 100 undo steps. Photoshop CS6 and earlier defaulted to 20 history states, but Photoshop CC 2019 and later offers unlimited undo by default. Notepad only supported a single undo step in older Windows versions, though Windows 11 Notepad now offers unlimited undo. Each application maintains its own undo stack separately in memory.

Can I undo after closing a file?

No — once you close a file and reopen it, the undo history is cleared. The undo stack lives in the application's memory during the current session only. After closing, changes that were saved are permanent unless the application supports a version history feature. Microsoft Word's Version History (available with OneDrive/SharePoint) and Google Docs' revision history both let you restore earlier versions of a document even after multiple sessions.

Does Ctrl+Z work in Gmail?

Ctrl+Z works inside the Gmail compose window to undo typing — it behaves like a normal text editor in that context. For undoing a sent email, Gmail offers a separate "Undo Send" feature that appears as a button in the confirmation banner immediately after clicking Send. This window is configurable between 5 and 30 seconds (set in Gmail Settings → General → Undo Send). It is not triggered by Ctrl+Z — you click the "Undo" button in the on-screen notification.

Can you undo Ctrl+Z (redo)?

Yes. To redo — reverse an undo — press Ctrl+Y on Windows and Linux, or Cmd+Shift+Z on Mac. Many applications also accept Ctrl+Shift+Z on Windows as an alternate redo shortcut (VS Code, Chrome, GIMP, and others). In Microsoft Word, Ctrl+Y is special: it re-applies the last action even if no undo was performed, which means it can repeat the last typed character or formatting change.

Why doesn't Ctrl+Z work sometimes?

Ctrl+Z may fail because: the application does not support undo (some web forms, terminals, and legacy software); you have reached the undo limit for that application; the undo history was cleared when the file was closed and reopened; another program is intercepting the Ctrl+Z keystroke (clipboard managers, macro tools, accessibility software); or the action is irreversible by design, such as emptying the Recycle Bin or using Shift+Delete to permanently remove a file.

How do I undo multiple actions at once?

Press Ctrl+Z repeatedly to step back through the undo history one action at a time. In applications with a visible history panel — such as Adobe Photoshop (Window → History) or Adobe Illustrator — you can click directly on any earlier state in the list to jump back multiple steps in a single click. In Microsoft Word, clicking the small dropdown arrow next to the undo button in the Quick Access Toolbar reveals a list of recent actions you can scroll and select to undo in bulk.

Comments

SK
Sophie K. — Vancouver, BC
April 16, 2026

I had no idea Ctrl+Z worked in File Explorer to undo deleted files. I just tested it and moved a file back to where it was in one second. I've been manually searching my Recycle Bin for years. This is a game-changer, thank you.

JM
James M. — Toronto, ON
April 16, 2026

The Git section is exactly what I needed. I've been using git reset --hard without fully understanding the consequences. The explanation of git revert vs git reset is the clearest I've read. Bookmarking this whole guide.

Leave a Comment