Reverting a file means going back to an earlier version of it

When you change a file and save it, the old version is usually gone — overwritten by the new one. But depending on what program you use and what your computer is set up to do, you may be able to recover an earlier version without starting over. The method depends on whether you're using Windows or Mac, what program created the file, and how recently you made the change.

The fastest way to undo a recent change is the undo command inside the program itself. If that window is still open, pressing Ctrl+Z (Windows) or Command+Z (Mac) will step backward through your edits one at a time. Once you close the program, that option is gone. After that, your options narrow to file recovery features built into your operating system, cloud backup if you're using one, or checking whether the program saved automatic backups.

Key Takeaways

  • Use Ctrl+Z or Command+Z while the program is still open to step backward through recent changes one edit at a time.
  • Windows File History and Mac Time Machine can restore earlier versions of a file if they were turned on before you made the change.
  • If you use OneDrive, Google Drive, or Dropbox, those services keep version history for a limited time and let you restore older copies.
  • Some programs like Microsoft Word and Google Docs save automatic backups inside the program itself, separate from your operating system.
  • Once a file is permanently deleted and no backup exists, recovery becomes much harder and may require professional data recovery.

Using undo while the program is still open

The simplest way to revert a change is to undo it before you close the file. Press Ctrl+Z on Windows or Command+Z on Mac, and the program will step backward one edit at a time. You can press it repeatedly to go back multiple steps. Most programs show you a list of recent edits if you hold down the key or look in the Edit menu, so you can see exactly what you're undoing before you do it.

This only works while the program is still open. Once you close the file and reopen it, the undo history is erased. If you've already saved the file with the unwanted changes, closing and reopening it won't help — the changes are now permanent in that file.

Restoring from Windows File History

Windows includes a built-in backup feature called File History that automatically saves copies of your files at regular intervals. If it's turned on, you can restore an earlier version of almost any file. To check whether File History is running and restore a file, open Settings, go to System, then click "Backup" in the left menu. You'll see whether File History is on and when it last ran.

To restore a specific file, right-click it in File Explorer and select "Restore previous versions." A window will open showing every backup copy Windows saved, along with the date and time each one was created. Click the version you want and click "Restore." The file will revert to that point. File History only works if it was turned on before you made the change, so if you've never set it up, it won't have any backups to show you.

Restoring from Mac Time Machine

Mac computers have a similar feature called Time Machine that works the same way. Open System Settings, click "General," then "Time Machine" to see whether it's turned on and when it last backed up. If it's on, you can restore an earlier version of any file on your computer.

To restore a file, open Finder, navigate to the folder containing the file, then click the Time Machine icon in the menu bar and select "Enter Time Machine." A timeline will appear on the right side of the screen showing when backups were made. Click backward through the timeline to find the version you want, click the file, then click "Restore." The file will revert to that point. Like Windows File History, Time Machine only has backups if it was turned on before you made the change.

Checking cloud storage version history

If you store files in OneDrive, Google Drive, or Dropbox, those services keep a version history of every change you make. The length of time they keep old versions varies — OneDrive keeps versions for 93 days, Google Drive keeps them indefinitely for files you own, and Dropbox keeps them for 30 days on the free plan and longer on paid plans.

To restore a previous version in OneDrive, right-click the file and select "Version history." A panel will open showing every saved version with timestamps. Click the version you want and select "Restore." In Google Drive, right-click the file, select "Version history," then "See all versions." Click the version you want and select "Restore this version." In Dropbox, right-click the file, select "Version history," and click "Restore" next to the version you want. The file will revert to that point, and the current version will be saved as a new entry in the version history so you don't lose it.

Using automatic recovery in Microsoft Word and Google Docs

Microsoft Word and Google Docs both save automatic backups separate from your operating system or cloud storage. In Microsoft Word, click "File," then "Info," then "Manage versions" or "Recover unsaved documents." A list of backup copies will appear with timestamps. Click the one you want to open it. If you want to keep it, click "Save As" to save it as a new file; if you just want to look at it, close it without saving.

In Google Docs, click "File," then "Version history," then "See version history." A timeline will appear on the right showing every change made to the document. Click any point in the timeline to see what the document looked like at that moment. Click "Restore this version" to revert the document to that point. Google Docs keeps version history indefinitely for files you own, so you can go back as far as the document has existed.

What to do if no backup exists

If you didn't have File History, Time Machine, or cloud backup turned on, and the file was closed before you realized the change was wrong, your options become limited. Check whether the program itself saved an automatic backup — look in the program's preferences or settings under "Recovery" or "Backup." Some programs save these in a hidden folder on your computer.

If no automatic backup exists and the file hasn't been deleted, the data is still on your hard drive but overwritten by the new version. Professional data recovery services can sometimes retrieve it, but this is expensive and not may provide to work. The best protection going forward is to turn on File History or Time Machine now, before you need it, so future changes are backed up automatically.

Frequently Asked Questions

Can I undo a change after I've closed the file?

Not through the program's undo command — that only works while the file is open. Your only option is to restore from a backup through File History, Time Machine, or cloud storage version history, if one exists. This is why turning on automatic backups now is important for protecting future work.

How far back can I restore a file?

It depends on your backup method. File History and Time Machine keep backups as long as your backup drive has space. Cloud storage keeps versions for a limited time: OneDrive for 93 days, Dropbox for 30 days (free plan) or longer (paid), and Google Drive indefinitely. Check your service's settings to see how long versions are kept.

If I restore an old version, what happens to the newer version?

In cloud storage, the newer version is saved as a separate entry in the version history, so you don't lose it. In File History and Time Machine, restoring overwrites the current file, so the newer version is gone unless you had another backup of it. Always check what you're about to restore before you click the button.

Why doesn't my File History or Time Machine show any backups?

These features only save backups if they were turned on before you made the change. If you just turned them on today, they won't have any history to show you. They need time to run their first backup, which usually happens within an hour of being turned on.

Can I recover a file I permanently deleted?

If it's still in your Recycle Bin (Windows) or Trash (Mac), right-click it and select "Restore." If you emptied the Recycle Bin or Trash, recovery becomes much harder and usually requires professional data recovery services. Prevention is much easier than recovery — keep backups turned on so you have options if something goes wrong.