How do I undo a file after saving?

We all make mistakes from time to time, and accidentally saving changes to an important file that you didn’t mean to make can be incredibly frustrating. Fortunately, with the right techniques, it is often possible to undo changes even after a file has been saved. In this comprehensive guide, we will walk through several methods you can use to revert a file back to a previous version after accidentally saving changes.

Use Your Operating System’s File History

One of the easiest ways to undo changes after saving a file is to use your operating system’s built-in file history or versioning feature. Windows, MacOS, and Linux all have the ability to restore previous versions of files.

Windows File History

Windows 10 and 11 have a built-in File History tool that continuously backs up copies of your files and allows you to restore to previous versions. To use it to restore an earlier version of a file:

  1. Open the File Explorer and navigate to the file you want to restore.
  2. Right click on the file and select “Properties”.
  3. Click on the “Previous Versions” tab.
  4. You will see a list of previous versions of that file. Click on the version you want to restore.
  5. Click “Restore” to overwrite the current version of the file with the selected earlier version.

MacOS Time Machine

MacOS has a similar file history feature called Time Machine. To use Time Machine to restore a file:

  1. Open the Finder and navigate to the file.
  2. Right click on the file and select “Enter Time Machine”.
  3. A Time Machine window will appear. Navigate back through your timeline to find previous versions of the file.
  4. Click “Restore” on the version you want to revert to. This will overwrite the current version.

Linux File Versioning

Linux distributions like Ubuntu have built-in snapshot tools to preserve file versions. To restore an earlier version of a file, open your file browser, right click on the file and look for a “Previous Versions” or “Local Versions” option to restore a snapshot.

Use Dropbox to Restore Previous Versions

If you have the file saved in a Dropbox folder, you can use Dropbox’s file versioning feature to restore a previous version. Dropbox saves 30 days of version history for files.

To restore an older version on Dropbox:

  1. Go to and login.
  2. Navigate to the file you want to restore.
  3. Click the three dots next to the file and select “Previous versions”.
  4. Select the version you want to restore.
  5. Click “Restore” to download that version and overwrite the current file.

Use Google Drive File Stream

If you have Google Drive File Stream set up on your computer, it maintains a version history of files similar to Dropbox. To restore a previous version of a file:

  1. Right click on the file and select “View previous versions”.
  2. Select the version you want to restore.
  3. Click “Restore” to overwrite the current version of the file.

Restore From Your Recycle Bin

If you accidentally deleted the file before realizing you needed to undo changes, check your computer’s Recycle Bin or Trash folder. On Windows, this is accessed through the Recycle Bin icon on your desktop. On Mac, it is in the Trash folder. This folder stores deleted files for a certain number of days before they are permanently deleted.

To restore a file from the Recycle Bin or Trash:

  1. Open the Recycle Bin / Trash folder.
  2. Locate the file you want to restore.
  3. Right click on the file and select “Restore”.

This will move the file back to its original location.

Use Git to Restore an Earlier Version

If you are collaborating on code or text files using Git, you can use Git’s powerful version control features to revert a file back to a previous commit. This requires some knowledge of using the Git command line tool.

To restore a file to a previous commit:

  1. Open your terminal/command prompt and navigate to the Git repository containing the file.
  2. Type “git log” to see a history of commits.
  3. Find and copy the commit hash of the version you want to restore.
  4. Type “git checkout ” where is the hash you copied.
  5. This will temporarily restore the files in that commit.
  6. To permanently overwrite, type “git revert ” where is the hash you copied.

This will permanently save the older version overwriting the newer file.

Use Your Text Editor’s Version Control

Many text editors and IDEs such as VS Code, Atom, and Sublime Text have built-in version control features that automatically save snapshots of files as you edit them. You can browse previous versions and restore to an earlier snapshot.

For example, in VS Code:

  1. Click on the file icon in the left sidebar.
  2. Click the clock icon in the top right to view history.
  3. Click on a previous snapshot.
  4. Click “Restore” to overwrite current version.

Check your text editor’s documentation for specific instructions on restoring file versions.

Find Auto-Saved Copies

Many programs automatically create backup saves as you work. You may be able to restore from these auto-saved file versions.

Microsoft Office AutoRecover

Microsoft Office applications like Word, Excel, and PowerPoint have an AutoRecover feature that saves incremental versions as you work. To restore one of these incremental saves:

  1. Open the Office program like usual.
  2. Look for the Document Recovery pane and click “Recover Unsaved Documents”.
  3. Locate the document and click the timestamp of the version you want.
  4. Click “Open” to load that auto-saved version.
  5. Use “Save As” to save this version with a new name.

Adobe Photoshop Auto-Saves

Photoshop periodically saves versions as you work under filenames like “YourFile-1.psb”. To restore one of these incremental saves:

  1. Restart Photoshop to load the latest normal save.
  2. Go to File > Open Recent > Recovered Files.
  3. Select the auto-saved version you want and click Open.
  4. Use “Save As” to save this version with the original filename.

This overwrites the previous save.

Use Cloud Backup Services

If you have an automated cloud backup service like Backblaze, Carbonite, Acronis, or iDrive, you may be able to restore previous versions of files from your online backups:

  1. Log into your backup service’s web portal or client software.
  2. Browse for the file you want to restore.
  3. Look for an option to view previous versions or restore from a certain date.
  4. Restore the version you want, overwriting the current local copy.

Consult your backup service’s documentation for detailed steps.

Restore From a Manual Backup

If you regularly back up important files to an external drive or cloud storage, you may have older copies stored there. You can manually restore these backups to undo changes.

For example, to restore a file from a manual Time Machine backup on Mac:

  1. Plug in the external backup drive.
  2. Open Finder and go to Applications > Time Machine.
  3. Locate the file you want to restore.
  4. Click Restore to copy that version from your backup and overwrite the current version.

On Windows, you can similarly restore files by plugging in your external drive and copying over the file version stored in the backup folder structure.

Recover Previous Versions from a Clone or Image

If you have a complete clone, disk image, or snapshot backup of your hard drive from an earlier time, you can explore this clone as a virtual drive to find previous versions of files. Tools like Macrium Reflect and EaseUS Todo Backup can mount backups as temporary virtual drives.

For example, to browse a Macrium Reflect image:

  1. Open the Macrium Reflect program.
  2. Click on “Home” > “Explore an Image”.
  3. Select the backup image containing the file version you want.
  4. Browse for the file and copy it from this virtual drive.
  5. Paste the copied file back into its original location to restore it.

Find Local File Copies

If you worked on the file across multiple devices, you may have an older local copy on another computer or drive that still has the changes you want to revert to. Try searching other devices for copies of the file.

You can also try using desktop search tools like Windows Search, Mac Spotlight or Linux Locate to hunt for copies of a specific filename across your whole computer or connected drives.

Look for Web Cache Versions

Web browsers like Chrome and Firefox cache copies of websites you visit so they load faster if you revisit them. If the file you are trying to restore was a web page, you may be able to find an older cached version through your browser.

Restore Cached Chrome Files

To view or restore cached Chrome files:

  1. Type chrome://cache in the URL bar and hit Enter.
  2. Search for the website name you want to restore.
  3. Right click on the file and select “Copy Link Address”.
  4. Paste this copied link in a new tab to open the cached version.
  5. Use right click > “Save As” to save a copy of this cached site.

Restore Cached Firefox Files

To restore cached Firefox files:

  1. Type about:cache in the URL bar and hit Enter.
  2. Search for the website name and click on the entry.
  3. Click “Save Page As” to save a copy of the cached version.

Contact Online File Hosts

If the file was stored on a cloud hosting service like Google Drive, Dropbox, etc, you can try contacting their customer support team to ask about restoring from backup. Most services keep point-in-time backups but don’t make these available through the standard user interface. A support rep may be able to help recover an earlier version of your lost file.

When contacting support, provide:

  • Your account email address
  • File name
  • Approximate date/time of the version you want to recover
  • Details about the changes you accidentally saved over

Make it clear you only need that one file reverted, not your whole account restored. With proof of ownership and a clear description of the issue, there’s a decent chance of getting help recovering the lost data.

Use Data Recovery Software

If all else fails, powerful data recovery software may be able to help recover earlier versions of files that have been accidentally overwritten or deleted. Tools like EaseUS Data Recovery, Stellar Data Recovery, or Disk Drill can scan your hard drive and reconstruct lost file versions from residual data on the drive.

To use data recovery software to restore a previous version:

  1. Download and install the data recovery tool.
  2. Scan your hard drive partition for lost file versions.
  3. Preview and identify the correct version of your file.
  4. Recover the file version found by the tool.
  5. Save the recovered file version with a new name.

This requires unused space hasn’t been overwritten with new data since you deleted or overwrote the file. The sooner you run the recovery tool after noticing the error, the better your chances.

Prevent Issues in the Future

To avoid issues recovering old file versions in the future, implement backup policies like:

  • Enable auto-save and recovery in your programs.
  • Set up cloud syncing services like Dropbox to versions files.
  • Use a cloud backup service to create online copies.
  • Regularly create manual backup copies to external drives.
  • Use version control systems like Git when collaborating on code.

With multiple backup layers in place, you’ll always have options to revert changes in case of accidental overwrites, saving headaches down the road.


Accidentally overwriting an important file can be frustrating, but is often fixable. Using built-in version histories, backups, caches, clones, and data recovery software, you can often find and restore previous copies even after saving over a file. Just don’t save any additional changes before attempting recovery. Enabling automatic versioning features and creating multiple redundant copies of critical files protects against this issue in the future.