ShareFlow
All articles

Tutorial

Lost a file in OneDrive or SharePoint? How to recover it

File deleted, moved or overwritten in OneDrive or SharePoint? 10 ways to recover it: search, Copilot, recycle bin, version history, audit log and backup.

Valentin Laurent10 min read
Share

A lost file in OneDrive or SharePoint can usually be recovered, as long as you look in the right order. A "lost" file in Microsoft 365 is either moved or renamed (still there, somewhere else), deleted (waiting in a recycle bin for 93 days), or overwritten (the old content is in version history). Here are ten methods, from the simplest, which users can do on their own, to the most technical, which only admins can run.

Diagnose it in 30 seconds

What happenedMethodWhoTime limit
I can't remember where I saved it1. Search, 2. CopilotThe userNone
I deleted it3. Recycle binThe user, or a site member93 days
It's there, but the content was overwritten4. Version historyThe userDepends on version settings
Hundreds of files are gone or encrypted5. Restore your OneDrive or the libraryThe user or the site admin30 days
It's gone from my PC, not from the web (or the reverse)6. Sync sideThe userDepends
Nobody knows what happened7. Audit logThe admin180 days (1 year with E5)
The recycle bin is empty or too late8 to 10. Retention, leaver's OneDrive, backupThe adminDepends on what was set up
Three-level diagram of the methods to recover a lost file in OneDrive or SharePoint. The user alone: search, Copilot, first-stage recycle bin for 93 days, version history, Restore your OneDrive over 30 days. The site owner or admin: second-stage recycle bin, Restore this library over 30 days. The tenant admin: Purview audit log for 180 days or one year, Preservation Hold library if a retention policy exists, deleted user's OneDrive, Microsoft 365 Backup up to 10 years
The ten methods, from the user alone to the tenant admin

Is the file really gone? Search before you restore

Method 1: search. Before restoring anything, search OneDrive on the web (onedrive.com or the Microsoft 365 app) with the Search box at the top. It searches file names and file content: one word you remember from the document is enough if you forgot its name.

If search finds nothing, check four places before giving up:

  • Recent and Shared in OneDrive: a file someone shared with you isn't in "My files", it lives with its owner;
  • the right account: many people have a personal and a work OneDrive, and save to the wrong one;
  • Personal Vault (personal accounts): its files never show in search results;
  • a Teams team: a file posted in a channel is stored in the team's SharePoint site, a file sent in a chat is in the sender's OneDrive.

A file a colleague shared with you and then deleted disappears from your side entirely. Only they can restore it, from their own recycle bin.

Find a file with Copilot

Method 2: Copilot. With a Microsoft 365 Copilot license, you can describe the file instead of guessing its name, in Copilot Chat or Copilot Search: "the budget deck Paul sent me last week", "the supplier contract edited in October". Copilot relies on the same search, but it understands a sentence where classic search expects keywords, and it combines author, date and topic.

Two limits. Copilot only shows files you already have access to. And it can't see the recycle bin: a deleted file is no longer indexed, so neither search nor Copilot will find it. Copilot Search is also coming to SharePoint and OneDrive search in 2027: see what changes with Copilot Search.

How do you restore a deleted file? The recycle bin

Method 3: the recycle bin. This is the method that saves the most files.

  • OneDrive for work or school: in OneDrive on the web, Recycle bin in the left pane, select the file, then Restore. Items stay there for 93 days, unless your admin changed it. Personal accounts: 30 days.
  • SharePoint or Teams: on the site, Recycle bin in the left pane (otherwise: Settings gear > Site contents > Recycle bin at the top right). From Teams: Files tab > Open in SharePoint. Any member with edit rights can restore files that other people deleted.

The file goes back to its original location. If its folder was deleted too, restore the folder first.

SharePoint site recycle bin: one text file selected, with its deletion date, who deleted it and who created it, the Delete and Restore buttons at the top, and at the bottom the link to the second-stage recycle bin
A site recycle bin: select the file, then Restore. The link at the bottom opens the second-stage recycle bin (demo tenant)

To restore hundreds of items at once, filtered by user or date, the UI won't cut it: see how to bulk restore the SharePoint recycle bin with PowerShell.

The file is there but overwritten: version history

Method 4: version history. When the file still exists but its content was replaced (a bad paste, an old copy that synced over it, a colleague who saved on top), the recycle bin won't help: version history holds the old content.

On the web: right-click the file > Version history, then the ellipsis (…) next to the version you want > Restore. In a synced folder, the same menu is available from a right-click in File Explorer. The restored version becomes the current one; the version you replace stays in the history, nothing is lost.

Version history works for every file type (Office, PDF, images, videos). How far back it goes depends on settings: SharePoint keeps at least 500 major versions by default, and admins can set other limits or turn versioning off on a library.

Everything was deleted or encrypted: restore to a date

Method 5: roll back a whole space. When the problem hits hundreds of files (mass deletion, a sync that wiped everything, ransomware), restoring file by file isn't realistic.

  • Restore your OneDrive: in OneDrive on the web, Settings gear > Restore OneDrive, if your organization allows it. Pick a date within the last 30 days, use the activity chart and activity feed to spot when things went wrong, then Restore. Everything created after that date goes to the recycle bin; you can undo the operation by running it again.
  • Restore this library, on the SharePoint side: in the library, Settings gear > Restore this library, same idea over 30 days. Only site admins can start it. It only works in the modern experience, can't bring back a library that was deleted entirely (that's the recycle bin's job) and needs versioning turned on.

If the option isn't in the menu, you don't have the rights, or the library uses the classic experience.

Restore this library page of a SharePoint document library: date dropdown set to Custom date and time, Restore button still greyed out, chart of activity over the last 30 days with a spike 26 days ago, a slider to move through time, then the list of changes to undo
Restore this library: the activity chart helps you spot the day things went wrong. Nothing is restored until you select Restore (demo tenant)

Gone from the PC but not the web, or the reverse: sync

Method 6: look at sync. OneDrive syncs deletions both ways: a file deleted from a synced folder on a PC is deleted for everyone, including in a shared SharePoint library.

  • Deleted on the PC: it's in the Windows Recycle Bin (or the Mac Trash) and in the OneDrive or SharePoint recycle bin on the web.
  • Deleted on the web, or an online-only file: it never reaches the Windows Recycle Bin. Use the web recycle bin.
  • Moved out of the OneDrive folder on the PC: it no longer syncs and disappears from the web, but it's still on the disk. File Explorer search will find it.
  • Never uploaded: a file created on a PC whose sync was stuck never reached the cloud. It's still on that PC and nowhere else.
  • Conflict copy: when two people edit the same file offline, OneDrive can keep both versions, adding the computer name to one of the file names. The "lost" file is often right next to it.

For a stuck or failing sync, see how to stop or fix SharePoint sync.

Admin side: who deleted or moved the file?

Method 7: the audit log. When nobody knows what happened, the Microsoft Purview audit log does: deletion, move, rename, with the user, the date and the path. It's also how you find a file that was moved to another site, which no recycle bin will ever show.

In the Microsoft Purview portal: Audit > Search, then filter on File, folder, or site (part of the name is enough, with *), on activities and on users. You need the Audit Logs or View-Only Audit Logs role. SharePoint and OneDrive events usually show up 60 to 90 minutes after the action.

Records are kept for 180 days with most licenses, and one year with Microsoft 365 E5 (or the E5 eDiscovery and Audit add-on). For a faster search than the UI, Exchange Online PowerShell is enough:

# Who deleted, moved or renamed a file whose name contains "Budget" in the last 30 days?
Connect-ExchangeOnline
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) `
  -RecordType SharePointFileOperation -Operations FileDeleted,FileMoved,FileRenamed `
  -FreeText "Budget" -ResultSize 1000 |
  Select-Object CreationDate, UserIds, Operations,
    @{ n = "File"; e = { ($_.AuditData | ConvertFrom-Json).ObjectId } } |
  Sort-Object CreationDate -Descending

The full path in the File column tells you where the file was moved, or which recycle bin to check.

Admin side: beyond the recycle bin

Method 8: the Preservation Hold library. If a Microsoft Purview retention policy applies to the site or OneDrive, a deleted file is first copied to the site's Preservation Hold library. Users can't use it: an admin gets the content back with eDiscovery. Without a retention policy, this library doesn't exist and the method doesn't apply.

Method 9: a leaver's OneDrive. When an account is deleted, its OneDrive is kept for 30 days by default (configurable in the SharePoint admin center, or with Set-SPOTenant -OrphanedPersonalSitesRetentionPeriod). During that time, the user's manager gets access. After that, the OneDrive spends 93 days in the site collection recycle bin, and only a SharePoint admin can restore it:

# Find and restore a deleted user's OneDrive
Connect-SPOService -Url "https://contoso-admin.sharepoint.com"
Get-SPODeletedSite -IncludeOnlyPersonalSite | Format-Table Url
Restore-SPODeletedSite -Identity "https://contoso-my.sharepoint.com/personal/first_last_contoso_com"

# Give yourself access to recover the files
Set-SPOUser -Site "https://contoso-my.sharepoint.com/personal/first_last_contoso_com" `
  -LoginName "admin@contoso.com" -IsSiteCollectionAdmin $true

The same Restore-SPODeletedSite brings back a deleted SharePoint site within 93 days.

Method 10: Microsoft 365 Backup. It's the only safety net beyond 93 days, if it was set up before the incident. It backs up the OneDrive accounts and sites you choose, with restore points every 10 minutes for the last two weeks, then weekly, and a retention period you can set from 3 months to 10 years. Billed pay-as-you-go ($0.15 per protected GB per month according to Microsoft Learn, restores are free). It restores a whole OneDrive or site to a point in time, in place or to a new URL; file-level restore is listed as "coming soon".

What I recommend setting up before it happens

  1. A one-page guide for support and users that follows the order of this article: search, Shared, recycle bin, versions, then the admin. Most requests are solved at steps 1 to 4.
  2. Check versioning on important libraries: without it, neither version history nor "Restore this library" works.
  3. Extend leavers' OneDrive retention if 30 days isn't enough for your HR process.
  4. Decide on a retention policy for sites holding binding documents (contracts, finance, HR): it keeps files beyond the recycle bin.
  5. Evaluate Microsoft 365 Backup for critical sites and executive accounts: it's the only protection after 93 days, and against a mass deletion discovered late.

To help your users understand where their files live (OneDrive, Teams, SharePoint) and stop losing them, that's the starting point of the SharePoint level 1 training. To set up retention and backup, that's the kind of project I help with in consulting.

Sources

Share this article

Know a colleague or client who deals with this? Send them the article in one click.

Read next

Comments

Loading comments…

Leave a comment

Comments are reviewed before they are published. Only your first name and last-name initial are shown.