Recover Overwritten Files with OneDrive Version History
In this article
If you accidentally overwrote a file in OneDrive, you can usually get the old version back using OneDrive's built-in version history. This works for files stored in your OneDrive folder on Windows, Mac, or on the OneDrive website. You don't need any special software—just a web browser and the file's location. Here's how to do it.
What You'll Need
- Access to the OneDrive website (onedrive.com) and sign in with the Microsoft account that owns the file.
- The file must have been overwritten after it was synced to OneDrive (i.e., it existed in the cloud before the overwrite).
- If the file is on your computer, it must be synced with OneDrive (the file has a blue cloud or green checkmark icon).
Step-by-Step
- Open the OneDrive website. Go to onedrive.com in your browser and sign in with the Microsoft account that has the file.
- Navigate to the file. Browse to the folder where the overwritten file is located. You can use the search bar at the top if you know the file name.
- Select the file. Click once on the file to highlight it. Do not double-click to open it yet.
- Find the "Version history" option. Look at the top toolbar—it should show a button labeled Version history (or sometimes an icon that looks like a clock with a circular arrow). If you don't see it, try right-clicking the file and selecting Version history from the context menu. The exact label may vary slightly by browser or region.
- View the versions. A side panel will appear listing all saved versions of the file, with timestamps and who made the change (if shared). The most recent version is at the top.
- Pick the version you want. Find the version from before the overwrite—look at the date and time to identify it. Click the three dots (⋯) next to that version, then choose Restore. Alternatively, you can click the version to preview it first.
- Confirm the restore. A pop-up will ask if you want to restore this version. Click Restore again. The file will be replaced with the older version, and the restored version becomes the current one.
- Check your file. Open the file to confirm it's the version you wanted. If you need the old version as a separate copy instead of replacing the current one, you can download it instead: click the three dots and choose Download.
If you're using the OneDrive desktop app on Windows or Mac, the version history is only available through the website—the desktop app doesn't have a direct "version history" button. However, any changes you make on your computer sync to the cloud, so the versions will still appear on the website.
Common Mistakes
- Looking in the wrong OneDrive account. If you have multiple Microsoft accounts (e.g., personal and work), make sure you're signed into the one that actually stores the file.
- Checking the wrong file. Version history is per-file. If you overwrote a file by copying another file over it, the version history of the original file still exists—but if you deleted the original and created a new file with the same name, the new file has its own version history, and the old one is gone unless it's in the recycle bin.
- Assuming version history is unlimited. OneDrive keeps versions for up to 30 days for free accounts, and up to 100 versions for Microsoft 365 subscribers (the older versions are deleted after 30 days unless you have a paid plan). If the overwrite happened more than 30 days ago, the old version may be gone.
- Restoring the wrong version. Always check the timestamp and preview the file before restoring. If you restore a version that's too old, you'll lose any changes made after that point.
Tips
- Use version history proactively. Before making major edits to an important file, you can create a manual version by saving a copy with a different name, but that's not necessary—OneDrive automatically saves versions when you edit and sync.
- Download a copy instead of restoring. If you want to keep the current version and also have the old one, download the older version to your computer. That way you have both.
- Check the recycle bin. If you accidentally deleted the file entirely, go to the OneDrive recycle bin (left sidebar) and restore it from there. Version history is separate from the recycle bin.
- For shared files. If the file is shared with others, version history also shows who made each change, so you can identify who overwrote it.
Troubleshooting
If you don't see the "Version history" option:
- Make sure you've selected the file (click it once) and are looking at the toolbar at the top of the page.
- Try right-clicking the file—some browsers hide the toolbar options until you right-click.
- If the file is in a folder that's shared with you but you don't have edit permissions, you may not see version history. Ask the owner to restore it.
If the version you want isn't listed:
- Check the date range. If the overwrite was more than 30 days ago, the version may have been purged. For Microsoft 365, versions are kept for up to 100 versions or 30 days, whichever comes first.
- If the file was overwritten by a sync conflict (e.g., two devices edited it at the same time), OneDrive may have created a separate copy like "file (1).txt"—check the same folder for that.
If restoring doesn't work:
- Close the file in any open apps (Word, Excel, etc.) before restoring. If the file is locked, the restore may fail.
- Refresh the browser page and try again.
- If you're on a mobile device, the OneDrive app may not show version history for all file types. Use a computer browser instead.
Frequently Asked Questions
How long does OneDrive keep file versions?
For free accounts, versions are kept for up to 30 days. For Microsoft 365 subscribers, versions are kept for up to 100 versions per file, but the 30-day limit still applies to each version unless you have a paid plan that extends it.
Can I recover a file that was overwritten by a sync conflict?
Yes. If a sync conflict occurs, OneDrive usually creates a second copy with a name like "file (1).txt" and keeps the original version intact. Check the same folder for that copy. If it's not there, use version history on the original file.
Does version history work for files stored only on my computer and not synced?
No. Version history only works for files that are actually stored in OneDrive (i.e., they have been synced to the cloud). If a file is only on your local hard drive and not in the OneDrive folder, you cannot use OneDrive version history.
Can I recover a version that was deleted more than 30 days ago?
Usually not. OneDrive automatically purges versions older than 30 days (or after 100 versions for paid plans). If the version is older than that, it's likely gone permanently. Your only hope is a backup you made yourself.
Does version history work for photos and videos?
Yes, but only for files that OneDrive recognizes as editable. For photos and videos, version history may not be available if the file type is not supported for versioning. In that case, you may only see the current version.
Can I restore a version without affecting the current one?
Yes. Instead of choosing "Restore," choose "Download" for the version you want. That downloads a copy to your computer, leaving the current version in OneDrive untouched.