How to Recover Deleted Files on a Computer: Windows and Mac Built-In Options

When you need to recover deleted files on a computer, Windows and macOS already include most of what can realistically help: a trash folder for recent deletions, a backup feature for older ones, and, on Windows, a command-line recovery tool from Microsoft for cases where neither applies. This guide follows the order in which those options should be tried and quotes the conditions that Microsoft, Apple and Google attach to each one, including the cases in which they say a file is gone for good.

Windows: start with the Recycle Bin

Microsoft’s instructions are short: open the Recycle Bin, select the files or folders you want, right-click them and select Restore. The file or folder goes back to its original folder. If you do not remember where that was, the Original Location column in the Recycle Bin window shows it before you restore.

Two situations leave the Recycle Bin empty even though the deletion was recent. First, Microsoft describes emptying the Recycle Bin as the step that completely removes files from the device, and its Storage Sense feature can do that automatically: Microsoft says Storage Sense frees up space by getting rid of items you do not need, “like temporary files and items in your Recycle Bin”. If files vanish from the bin on their own, review the Storage Sense settings. Second, Microsoft’s OneDrive help points out that files deleted from the cloud, including files marked as online-only, do not appear in the computer’s Recycle Bin; they are in the OneDrive recycle bin on the web, described further down.

Windows: File History and “Restore previous versions”

File History is Windows’ built-in versioned backup, but it only helps if it was turned on before the file was lost. Microsoft says it needs an external drive connected to the computer or a network location, and that it automatically backs up your libraries, including Documents, Pictures, Videos and Music, along with the Desktop. To turn it on, open Control Panel, go to System and Security, select “Save backup copies of your files with File History” and select Turn on.

To get a deleted file back from File History, Microsoft’s steps are:

  • Open File Explorer and go to the folder that used to contain the file.
  • Right-click the folder name and select Restore previous versions.
  • On the Previous Versions tab, pick a version from a date when the file still existed.
  • Select Restore, or use Restore to… to save the copy somewhere else.

Microsoft attaches a warning to the plain Restore button: the restored file or folder replaces the current version on the computer, and the replacement cannot be undone. When you are restoring a whole folder to retrieve one file, “Restore to…” is the safer choice, because it leaves the current contents untouched.

Windows File Recovery: Microsoft’s own recovery tool

For files that are not in the Recycle Bin and not in any backup, Microsoft offers Windows File Recovery, a command-line app in the Microsoft Store for Windows 10 and Windows 11. (Microsoft’s page also reminds readers that support for Windows 10 ended on October 14, 2025.) It attempts to find files whose space has been marked as free but not yet reused.

The command has this form: winfr source-drive: destination-drive: followed by a mode and optional switches. Microsoft’s page explains which of the two basic modes to use:

File systemSituationMode
NTFS (internal drives, external hard drives, larger USB drives)Deleted recentlyRegular
NTFSDeleted a while ago, or the disk was formatted or is corruptedExtensive
FAT and exFAT (SD cards, small USB drives)AnyExtensive

Two of Microsoft’s examples show how the /n switch narrows the search. To look for PDF and Word files on drive C and save what is found to drive E: winfr C: E: /regular /n *.pdf /n *.docx. To look for any file with “invoice” in its name on drive E and save to drive C: winfr E: C: /extensive /n *invoice*. After you confirm with Y, the tool writes its results to a folder named Recovery followed by the date and time on the destination drive.

Microsoft sets conditions that are worth taking literally. The source and destination drives must be different, which means you need a second drive or a USB stick to receive the recovered files. To improve the chances, you should minimize or avoid using the computer, since every download, update or saved document can land on the space the lost file occupied. And the result is not promised: the page says it is possible that the free space was overwritten, especially on a solid-state drive. The reason SSDs are singled out, a feature called TRIM, is explained in our article on how to recover deleted videos. If Regular mode finds nothing, Microsoft’s suggestion is to try Extensive mode before giving up.

Mac: Trash and “Put Back”

On a Mac, the macOS User Guide says an item in the Trash can be returned by selecting it and choosing File, Put Back, or simply by dragging it out. The guide also names the settings that empty the Trash without your noticing:

  • In Finder Settings, under Advanced, “Remove items from the Trash after 30 days” deletes each item automatically 30 days after it was put there.
  • Items moved to the Trash from iCloud Drive are emptied after 30 days regardless of that Finder setting.
  • Control-clicking an item in the Trash and choosing Delete Immediately removes that one item at once.

Apple’s warning applies to all three: any items emptied from the Trash are permanently deleted and are no longer available.

Mac: Time Machine

Time Machine is the macOS counterpart of File History, with the same precondition: it must have been set up on an external disk beforehand. On macOS Ventura 13 or later, Apple’s setup path is System Settings, General, Time Machine, Add Backup Disk, Set Up Disk. Apple says Time Machine keeps hourly backups for the past 24 hours, daily backups for the past month and weekly backups for all earlier months, and deletes the oldest backups when the backup disk is full. It recommends a disk with at least twice the storage capacity of the Mac.

To restore a file, Apple’s steps are to open a Finder window for the folder where the item used to be, open Time Machine (Apple suggests using Spotlight to find it), use the arrows or the timeline at the right edge to move back to a backup that contains the item, select it and click Restore. Restored items return to their original location. For a document that was changed, not deleted, Apple notes that many apps offer File, Revert To, Browse All Versions, which avoids restoring from the backup disk at all.

Files stored in OneDrive, Google Drive or iCloud Drive

Cloud folders have their own trash, separate from the computer’s, and each has a published time limit.

OneDrive

Microsoft says personal accounts can restore files or folders deleted within the last 30 days, and work or school accounts within the last 93 days unless the administrator changed the retention setting. Sign in at onedrive.com, open Recycle bin in the navigation pane, select the items and choose Restore. Files deleted from a Personal Vault appear only after you choose Show Personal Vault items. Microsoft 365 subscribers have an extra option: restoring the entire OneDrive to any point in the last 30 days, which is useful after a mass deletion. The limits are stated just as clearly. You cannot restore items after they have been permanently deleted from the OneDrive recycle bin, you can only restore from your own OneDrive and not files others shared with you, and for personal accounts Microsoft’s support agents are not allowed to access your files.

Google Drive

Google Drive Help says files moved to the Trash are deleted forever after 30 days, or sooner if you click Empty trash. To restore, open drive.google.com, click Trash in the left menu, right-click the file and choose Restore; sorting by “Trashed date” shows how long each item has been there. Google adds a detail about shared files: while a file you own is in the Trash, the people you shared it with can still open it, and they lose access only when it is permanently deleted.

iCloud Drive

The iCloud User Guide gives the same 30-day window. Sign in at icloud.com/iclouddrive, select Recently Deleted in the sidebar, choose the files and select Recover; they return to the folder they were in.

Which option fits which situation

  • Deleted today from a local folder: Recycle Bin on Windows, Trash on a Mac.
  • Deleted from a folder that syncs with the cloud: the web recycle bin of OneDrive, Google Drive or iCloud Drive.
  • Deleted weeks ago, backup was on: File History on Windows, Time Machine on a Mac.
  • Deleted and the bin was emptied, no backup, hard disk drive or SD card: Windows File Recovery, run as soon as possible and saving to a different drive.
  • Deleted and the bin was emptied, no backup, SSD: Microsoft’s tool can still be tried, but its own page warns that the space may already have been overwritten.

If the last two lines describe your situation, the practical lesson is to turn on a backup today. For photos in particular, see our guide on how to back up phone photos, and for pictures lost on a phone, the guide on how to recover deleted photos on Android.

Frequently asked questions

Can I recover files after emptying the Recycle Bin?

Sometimes. Microsoft’s Windows File Recovery exists for files that can no longer be restored from the Recycle Bin, but it depends on the space not having been reused. A File History backup, if one exists, is more dependable.

Does File History work if I never turned it on?

No. It needs an external drive or network location and must be enabled first. The Previous Versions tab will be empty for folders that were never backed up.

Does Windows File Recovery work on a USB stick or SD card?

Yes, according to Microsoft, using extensive mode, because those devices normally use FAT or exFAT. The recovered files must be saved to a different drive.

Is there a Mac equivalent of Windows File Recovery from Apple?

Apple’s documentation covers the Trash, Time Machine and iCloud recovery only, and it states that items emptied from the Trash are no longer available. Apple does not publish a scanning tool comparable to Microsoft’s.

\
Trends