Recover After Clicking Replace File on Mac
In this article
If you clicked “Replace” when moving or saving a file on your Mac, the original file is usually not gone forever—macOS keeps a version in the trash or in a local backup. The fastest way to recover it is to check the Trash first, then use Time Machine or the “Revert To” feature in apps. Here’s exactly how to do it, step by step.
What You'll Need
- Access to the Mac where the replacement happened
- If you use Time Machine, the backup drive must be connected
- If you don’t use Time Machine, check if “Local Snapshots” are enabled (they are by default on laptops with APFS)
Step-by-Step
- Check the Trash immediately. Open the Trash from the Dock. Look for the original file (it may have the same name as the new file, but with a different modification date). If you see it, right-click it and choose “Put Back” to restore it to its original location.
- If the file is not in the Trash, check Time Machine. Connect your Time Machine backup drive (if you have one). Then open the folder where the replaced file was located (for example, Documents). Click the Time Machine icon in the menu bar (the clock with a circular arrow) and choose “Enter Time Machine.” Alternatively, open the folder and press Command + Shift + T (if Time Machine is set up).
- Browse through backups. In Time Machine, use the timeline on the right edge to go back to a time before the replacement. You’ll see the folder as it was then. Select the original file and click “Restore.” Time Machine will copy it back to its original location (or ask you where to put it).
- If you don’t have Time Machine, try “Local Snapshots” (APFS). On Macs with solid-state drives and APFS, macOS automatically creates local snapshots. To see them, open the folder where the file was, then go to Version (if the file was a document) or use the “Revert To” feature in the app you used. For example, in Pages, TextEdit, or Preview, open the new file, then go to File > Revert To > Browse All Versions… (or “Browse Versions”). A timeline will appear—select an earlier version and click “Restore.”
- If the file was replaced in Finder (e.g., you dragged a file and chose “Replace”), check the “Previous Versions” in Finder. Right-click the new file in Finder, hold down the Option key, and choose “Browse Previous Versions” (if available). This works for files that have version history, like those edited in Apple apps.
- Use a third-party recovery tool as a last resort. If nothing else works, you can try data recovery software like Disk Drill or Data Rescue. These can scan your drive for deleted files, but they are not guaranteed to work, especially if the drive has been written to since the replacement. Download only from the official developer websites.
Common Mistakes
- Emptying the Trash before checking. Once you empty the Trash, the file may still be recoverable with third-party tools, but it’s much harder. Always check the Trash first.
- Waiting too long before using Time Machine. Time Machine backups happen hourly (if the drive is connected). If you wait days, the backup from before the replacement may be overwritten by newer backups. Act quickly.
- Using the “Replace” option again. If you try to restore a file and then click “Replace” again, you might overwrite the same file again. Be careful with dialog boxes.
- Assuming the file is gone forever. Many people panic and start downloading recovery tools immediately, which can overwrite the data. Stay calm and try the built-in methods first.
Tips
- Enable Time Machine now. Go to System Settings > General > Time Machine (or System Preferences > Time Machine on older macOS) and set up a backup drive. This is the most reliable way to recover from any accidental file loss.
- Use the “Keep Both” option when copying. When you drag a file to a folder that already has a file with the same name, macOS offers “Keep Both,” “Replace,” or “Stop.” Choosing “Keep Both” preserves the original file (with “ 2” appended to the name).
- Be aware of versioning in Apple apps. Apps like Pages, Numbers, Keynote, TextEdit, and Preview automatically save versions as you work. You can access them via File > Revert To.
- Check the “Recently Deleted” folder in Photos. If the replaced file was a photo, it might be in the Photos app’s “Recently Deleted” album (available for 30 days).
Troubleshooting
If Time Machine doesn’t show the file: Make sure the backup drive is connected and that backups were running before the replacement. If you never set up Time Machine, it won’t have any backups. Try local snapshots instead (step 4).
If “Revert To” is greyed out: This feature only works for files that have version history (usually created by Apple apps). If you replaced a file that was not created by an app that supports versions, this option won’t appear. In that case, rely on Time Machine or recovery software.
If the Trash is empty: The file might still be on the disk but marked as deleted. Stop using the Mac immediately (avoid saving new files, downloading, or even opening many apps) to prevent overwriting. Then use a recovery tool like Disk Drill (free trial) or Data Rescue.
If the replacement happened on an external drive: Time Machine may not back up external drives unless you explicitly included them in the backup settings. Check your Time Machine settings. If the external drive is not backed up, recovery is harder—try recovery software directly on that drive.
If you replaced a folder: Recovering a replaced folder is trickier. Check Time Machine for the folder’s previous state. If you don’t have a backup, you may need to recover individual files from the new folder’s “Previous Versions” (if any) or use recovery software to find deleted files.
Frequently Asked Questions
Can I undo the “Replace” action with Command+Z?
Sometimes yes, but only if you haven’t done anything else since the replacement. Immediately after clicking “Replace,” press Command+Z (Undo) in Finder. If it works, the original file will be restored. If not, move on to the other methods.
Does the Trash always contain the replaced file?
No. When you replace a file via drag-and-drop or the “Replace” button, macOS may or may not move the old file to the Trash. It depends on the context. For example, when you save a new version of a document from an app, the old version is not sent to the Trash—it’s replaced within the app’s version history. So always check the Trash, but don’t rely on it.
What if I don’t have Time Machine set up?
You can still try local snapshots (APFS) or third-party recovery software. Local snapshots are automatic on Macs with SSDs and APFS, but they are temporary and may be deleted when the disk runs low on space. To check for local snapshots, open the folder and use the “Browse Previous Versions” option (right-click with Option key) or use Time Machine (even without a backup drive, it shows local snapshots).
Will recovery software always work?
No. Recovery software works best if the file’s data hasn’t been overwritten. If you’ve been using the Mac normally after the replacement, the chances decrease. It’s worth trying, but it’s not guaranteed.
How do I prevent this from happening again?
Always choose “Keep Both” when copying files with the same name. Set up Time Machine. For documents, use apps that support versioning (like Pages or Word) and save frequently. Also, consider using a cloud storage service like iCloud Drive, which keeps version history for many file types.
Can I recover a replaced file from iCloud Drive?
If the file was stored in iCloud Drive, you can go to iCloud.com, sign in, and check the “Recently Deleted” folder (for files deleted within 30 days). However, if you replaced a file (not deleted), iCloud may not keep the old version. You can also check the version history in iCloud Drive if the file type supports it (e.g., Pages, Numbers).