A file you deleted for good is often still on the drive for a while. Windows usually just frees up the space it used, and the data stays until something new is written over it. So the first rule is to use the PC as little as you can, and to save anything you recover to a different drive. Then work through the options below, from the easiest to the most technical.
Look in the Recycle Bin or undo the delete
A file removed with the normal Delete key goes to the Recycle Bin. Open the Recycle Bin on the desktop, right-click the file and choose Restore, or drag it back to a folder. A file removed with Shift + Delete skips the bin, and so does anything you removed after emptying it. If you deleted something a moment ago, click inside that same folder and press Ctrl + Z, or right-click blank space in the folder and choose Undo Delete. Do this before you restart the PC.
Restore a deleted file from File History or Previous Versions
This works only if File History was already turned on and saving to an external drive or network location before the file disappeared. If it was, the copies are waiting for you.
- Open File Explorer and browse to the folder holding the file. If the folder sat at the top level of a drive, such as C:\, you will use the drive itself in the next step. If File Explorer won't open, the File Explorer fixes come first.
- Right-click the folder, choose Show more options, then Restore previous versions.
- Open the Previous Versions tab and choose a copy dated before the deletion; if you lost the file today, a copy of the folder from yesterday should still hold it.
- To look first, expand Open and pick Open in File History. Then use Restore to bring the file back, or expand it and pick Restore to... so the file goes somewhere new and the existing version stays untouched.
Use the File History window instead
You can reach the same backups from the Control Panel. Open Control Panel, go to System and Security, then File History, and click Restore personal files on the left. Browse to the copy you need with the controls at the bottom, select the file or folder and click the green restore button. For a file that lives in a library, right-click it in the folder where it is actually saved rather than in the library view.
Get deleted files back from OneDrive
If the file was in a OneDrive folder, it may still be online. Sign in to the OneDrive website with the same Microsoft account and open its Recycle Bin first. When the file is not there, or many files went at once, use Restore your OneDrive from the Settings menu on that site. Pick a date from the dropdown, such as Yesterday, or choose Custom date and time. Look through the activity chart and feed, select the earliest action you want to undo, and click Restore. Every action after the one you pick is undone as well. On a personal account this page needs a Microsoft 365 subscription, so without one you will be sent to a help page instead.
Recover files with Windows File Recovery
When there is no backup and the file is gone from the bin, the free Windows File Recovery app from the Microsoft Store is the next step. It runs from a command window, supports Windows 11 as well as Windows 10 version 2004 or later, and reads internal drives, external drives, USB sticks and memory cards. It cannot bring back files from cloud storage or network shares. The source drive and the destination drive must be different, so with only one drive, plug in a USB or external drive to receive the files.
- Install Windows File Recovery from the Microsoft Store if you do not have it.
- Press the Windows key, type Windows File Recovery and open it. Select Yes when Windows asks to allow changes.
- In the Command Prompt window, type a command in the format shown below, then press Enter.
- Type Y when asked to continue. A large drive can take a long time. Press Ctrl + C to stop.
winfr source-drive: destination-drive: [/mode] [/switches]
Write the command so it finds the right files
A filter stops stray system files from filling the results. For example, this looks on C: for Word and PDF files and saves them to E:.
- Always write drive letters with the colon, and keep a space between the source and the destination.
- End a folder name with a backslash, for example /n \Myfolder\.
- Put quotes around any name that contains spaces.
- Use a wildcard such as *.xlsx when you do not remember the file name.
- The recovered files land in a folder named Recovery_ followed by the date and time, on the destination drive.
winfr C: E: /regular /n *.docx /n *.pdf
Pick Regular or Extensive mode
The mode depends on the drive's file system. You can see it by right-clicking the drive in File Explorer and choosing Properties. Windows File Recovery has no graphical window, no tool can bring back data that was overwritten or erased by TRIM, and recovered files must be saved to a different drive.
- NTFS drive, file deleted recently: /regular.
- NTFS drive, file deleted a while ago, drive formatted or corrupted: /extensive.
- FAT or exFAT, which is common on SD cards and small USB sticks: /extensive is the only mode that works.
- If Regular finds nothing and the file type is supported, run the search again in Extensive mode.
Why files on an SSD are much harder to get back
On an SSD, deleted data tends to disappear sooner than on a hard drive. The reason is TRIM, a command Windows sends so the drive knows which blocks no longer hold anything useful. The drive may then erase those blocks on its own, and once it has, no tool can read them. Windows has used TRIM automatically since Windows 7. Microsoft's own page warns that free space may already be overwritten, especially on an SSD. To see whether it is active, open an elevated Command Prompt or Terminal then enter the line shown here: a result of 0 means TRIM is on, and 1 means it is off. An external USB SSD may not receive TRIM through the USB adapter, so files deleted from one may still be there. Typing the command in the box lets you check whether TRIM is switched on for your drive. Whichever drive you have, stop using it, and run any recovery tool from a different drive so nothing is written over the lost data.
fsutil behavior query DisableDeleteNotify
When Windows File Recovery will not install, run or finish
- It is not built into Windows. Get it from the Microsoft Store, and make sure you are on Windows 10 version 2004 or later or on Windows 11.
- A message that the source and destination cannot be the same partition means you need a second drive to hold the recovered files. Do not create a new partition on the damaged drive.
- If it says the destination disk is full, free up space there and then choose R to resume, S to skip the file or A to abort.
- Extensive mode can take a long time on a large drive.
- If the destination drive is nearly full, free up room on it, then try the recovery again.