How to Restore OneDrive Files Deleted by “Automatic Cleanup”

When files disappear due to an “Automatic Cleanup” routine in Microsoft OneDrive or Windows, local documents and folders vanish without explicit user deletion. This typically happens when Windows Storage Sense dehydrates or purges local cached copies, cloud retention policies enforce routine item retirement, or the OneDrive client processes an automated cleanup rule. Depending on how the cleanup executed, the files are either resting in your cloud recycle bins or have simply been converted into online-only stubs.

Fast Fix:
Check the cloud recycle bin first. Sign in to OneDrive for Web in your browser, select Recycle bin from the left navigation, select your missing files, and click Restore. If you are on a work or school account and the first bin is empty, scroll down and open the Second-stage recycle bin to recover the purged items.

Diagnostic Snapshot

  • Trigger Sources: Windows Storage Sense automated policies, Microsoft 365 retention or auto-expiration rules, mobile app “Clean up space” actions, or corrupted local placeholder synchronization.
  • Recovery Window: 30 days for Personal Microsoft Accounts; 93 days across First and Second-Stage Recycle Bins for Work or School (SharePoint/OneDrive for Business) accounts.
  • Severity Level: Moderate to High. Files are recoverable if acted upon within the cloud retention lifecycle, but permanent data loss can occur once second-stage retention expires.

What “Automatic Cleanup” Actually Did to Your Files

To recover your data effectively, you must determine whether your files were actually deleted or simply dehydrated:

  1. Dehydration vs. Deletion (Storage Sense): In many cases, automatic cleanup does not delete files from your cloud account. Instead, Windows Storage Sense flags locally cached files that have not been opened recently and removes the physical bytes from your hard drive, leaving a zero-byte placeholder with a blue cloud icon. If you mistake this for deletion.
  2. First-Stage Cloud Recycle Bin: When an automated script, mobile “Free up space” command, or synchronization fault issues a true deletion command, the files move immediately to your OneDrive cloud Recycle Bin.
  3. Second-Stage (Site Collection) Bin: For enterprise accounts, if an automated cleanup policy purges the user’s primary recycle bin, the data is held in the tenant’s second-stage bin until the 93-day retention cycle concludes.

Step-by-Step Restoration Process

Follow these recovery steps in order, moving from the primary cloud interface down to advanced point-in-time rollbacks.

1. Restore from the Primary Cloud Recycle Bin
Never rely solely on your local desktop Recycle Bin, as cloud-side automated cleanups bypass local trash folders.

  1. Open a browser and sign in to OneDrive for Web.
  2. In the left navigation pane, click Recycle bin.
  3. Sort the list by Date deleted to locate the automated cleanup batch.
  4. Select the files or parent folders you need, then click Restore in the top navigation bar.
  5. The items will return to their original directory locations both online and in your local File Explorer.

2. Check the Second-Stage Recycle Bin (Work/School Accounts)
If the primary recycle bin is empty or was cleared automatically by an administrator script:

  1. In the cloud Recycle Bin page, scroll to the bottom of the list.
  2. Look for the link: “Can’t find what you’re looking for? Check the Second-stage recycle bin.”
  3. Click the link to open the administrative collection bin.
  4. Select the deleted items and click Restore.

3. Perform a Point-in-Time Account Rollback (OneDrive Restore)
If a massive automated cleanup purged thousands of files, disorganized your directory structure, or created widespread version corruption, use the native Microsoft 365 point-in-time recovery tool:

  1. In OneDrive for Web, click the Settings (gear icon) in the top-right corner.
  2. Select Options (or Restore your OneDrive directly).
  3. Under the Restore your OneDrive screen, select a date from the dropdown (e.g., Yesterday, Custom date and time).
  4. Review the activity chart to identify the exact hour the automatic cleanup occurred.
  5. Slide the timeline marker back to just before the cleanup event and click Restore.
  6. Microsoft 365 will roll back all file operations, restoring deleted files and reversing accidental modifications.

(Note: Rolling back will revert all files modified after that selected timestamp. Make local backup copies of any new documents created after the cleanup event before running this operation.)

4. Adjust Storage Sense to Prevent Recurring Deletions
If Windows is repeatedly stripping local files or triggering unwanted cleanup loops:

  1. Press Windows Key + I to open Settings.
  2. Navigate to System > Storage > Storage Sense.
  3. Under OneDrive content, review the setting for Content will become online-only if not opened for more than:.
  4. Set this dropdown to Never if you want your files to remain permanently downloaded on your hard drive.
  5. For broader configuration conflicts between Windows disk optimization and sync engines.

Escalation & Administrative Hard Stops

  • Tenant Retention Policies: If your files were removed by a Microsoft Purview retention label or compliance disposal rule configured by your enterprise IT team, end-user restoration from the recycle bin may be blocked or overridden. Contact your Microsoft 365 global administrator to check the Preservation Hold library.
  • Exceeded Retention Limit: If more than 30 days (personal) or 93 days (business) have elapsed since the automated cleanup script ran, files are permanently purged from Microsoft server storage. At this stage, self-service tools cannot recover the items, and restoration requires restoring from an external offline backup or tenant-level third-party backup solution.