How to Recover Accidentally Deleted Files

To recover accidentally deleted files, start with the places that keep deleted items on purpose, then move to backups and older versions, and only then to recovery software. Windows and macOS both have a trash folder, both have a built-in backup tool that keeps earlier versions of files, and the main cloud services keep deleted files for 30 days or more. Most documents lost by mistake come back from one of these, without any special program.

Advertisement

The steps below follow that order for Windows, macOS, iPhone, Android and cloud storage, using the instructions published by Microsoft, Apple, Google and Dropbox, checked in November 2026.

Why a deleted file can still be recovered

When you delete a file from the trash or skip the trash, the system usually does not erase its contents. It removes the entry that points to the file and marks the space as free. The data stays physically on a hard disk or memory card until new data is written over it, which is why recovery tools work and why Microsoft's own recovery guide advises minimizing or avoiding use of the computer after a loss. Solid-state drives (SSDs) are the main exception, explained further below.

1. The Recycle Bin and the Trash

Windows

Open the Recycle Bin on the desktop, find the file (sorting by "Date deleted" helps), right-click it and choose Restore. It returns to its original folder. Some deletions never reach the Recycle Bin, though:

Advertisement

  • Files deleted with Shift+Delete are removed directly.
  • By default, files deleted from removable media such as USB flash drives and memory cards, or from network drives, are not stored in the Recycle Bin.
  • When the bin is full, the oldest files are deleted to make room, and a file too large for the bin is offered for immediate permanent deletion.

macOS

Open the Trash in the Dock, right-click the file and choose Put Back. Since macOS Sierra there is an option to empty the Trash automatically after 30 days, so on Macs where it is turned on, older items will no longer be there.

2. Cloud services: deleted files folders

ServiceWhere to lookRetention
Google Drivedrive.google.com > Trash (sort by "Trashed date")30 days
OneDriveonedrive.com > Recycle bin30 days for personal accounts; 93 days for work or school, unless changed by the administrator
Dropboxdropbox.com > Deleted files30 days (Basic, Plus, Family); 180 days (Professional, Essentials, Standard, Business); 365 days (Advanced, Business Plus, Enterprise, Education)
iCloud Driveicloud.com/iclouddrive > Recently Deleted30 days

Two details save time. In OneDrive, files that were "online-only" on the computer do not go to the computer's Recycle Bin when deleted; they appear only in the recycle bin on the website. In iCloud, files deleted from apps other than iCloud Drive can sometimes be found in Data Recovery: go to icloud.com/recovery, choose Restore Files and select the items. Apple advises not to edit or delete iCloud Drive data while a recovery is running.

OneDrive also offers Microsoft 365 subscribers the option to restore a previous version of a file or to roll back the whole OneDrive to any point in the last 30 days, which is useful when many files were deleted or damaged at once, for example by malware.

3. Previous versions and backups

Windows: File History

File History backs up the Documents, Pictures, Videos, Music and Desktop folders, plus any custom libraries, to an external drive or network location. It has to be turned on beforehand: in Control Panel, under System and Security, choose "Save backup copies of your files with File History" and select Turn on. If it was running, restore a file like this:

  1. Open File Explorer and go to the folder that contained the file.
  2. Right-click the folder and select Restore previous versions.
  3. Pick a version from before the deletion.
  4. Use Restore, or "Restore to..." to save it elsewhere without replacing the current folder. Microsoft warns that a plain restore replaces the current version and cannot be undone.

macOS: Time Machine

Time Machine, introduced with Mac OS X Leopard in 2007, keeps hourly backups for the past 24 hours, daily backups for the past month and weekly backups for older periods, deleting the oldest weekly copies when the disk fills. To restore:

  1. Open a Finder window of the folder where the file was (not needed for the desktop).
  2. Open Time Machine from Spotlight.
  3. Use the arrows or the timeline to move back to a backup that contains the file.
  4. Select it and click Restore; it returns to its original location.

For a document that still exists but was overwritten, many Mac apps offer File > Revert To > Browse All Versions, which shows earlier versions saved by the system.

4. Phones

iPhone and iPad: in the Files app, open Browse and then Recently Deleted. Items from iCloud Drive stay there for 30 days. Photos and videos have their own Recently Deleted album in the Photos app, also kept for 30 days.

Android: file managers such as Files by Google and the manufacturers' own apps have a trash section where deleted files can be restored. Photos deleted in Google Photos stay in its trash for 30 days; older guides that mention 60 days are out of date.

5. Recovery software

If the file is in no trash folder and no backup, a recovery program can scan the drive for the data that remains. Two free options come from trustworthy sources:

  • Windows File Recovery, Microsoft's command-line tool for Windows 10 and 11, from the Microsoft Store. Use regular mode for recent deletions on NTFS drives (most computer disks) and extensive mode for older deletions, formatted or corrupted disks and FAT or exFAT drives (most memory cards and small USB drives). Example: winfr C: E: /regular /n \Users\YourName\Documents\ recovers a Documents folder to drive E:. Another example, winfr E: C: /extensive /n *invoice*, finds files whose names contain "invoice". The source and destination drives must be different.
  • PhotoRec, free and open-source software that, despite the name, recovers more than 480 file extensions, including Office documents, PDF and ZIP. It ignores the damaged or missing file system, reads the drive in read-only mode and runs on Windows, macOS and Linux. Its companion program, TestDisk, recovers lost partitions.

Commercial tools such as Recuva, Disk Drill, EaseUS Data Recovery Wizard and Stellar Data Recovery work the same way with a graphical interface; most scan for free and charge to save files. Whichever you use, install it and save the results on a different drive from the one you are scanning, so the recovery does not overwrite the files you want.

What recovered files can look like

When the file system no longer has the file's name and location, programs identify files by their internal signature: a PDF starts with the characters "%PDF-", and Word, Excel and PowerPoint files in the modern format start like ZIP archives. That is why recovered files often come back with generic names such as f1234567.docx and have to be opened one by one. Large files are more likely to have been stored in several fragments; in a study of more than 350 disks by Simson Garfinkel, 17 percent of Word documents and 58 percent of Outlook PST mailbox files were fragmented, and fragmented files may come back damaged.

6. SSDs: why recovery is often impossible

Most modern laptops use SSDs, which support a command called TRIM. The operating system uses it to tell the drive which blocks no longer hold valid data, and the drive erases them internally. After TRIM and the drive's garbage collection run, recovering deleted data can be difficult or impossible, depending on the drive's firmware. Windows has used TRIM since Windows 7 (2009) and macOS since Mac OS X 10.6.8 (2011). On an SSD, the trash, the cloud and backups are therefore far more reliable than any scan, and a scan should be attempted as soon as possible after the deletion, if at all.

7. Professional data recovery

Laboratories that specialize in data recovery can sometimes read drives that no longer work, after a fall, water damage or an electronic failure, by repairing the drive in a controlled environment or reading the memory chips directly. The cost is high and success is not guaranteed. If a drive has stopped working or behaves erratically, avoid switching it on again and again before getting help, because that can make the damage worse.

How to avoid losing files again

  • Turn on File History or Time Machine with an external drive. Both work in the background once configured, and they also protect against files being overwritten, not just deleted.
  • Keep working folders in a synced cloud folder, so deleted files go to a recycle bin that lasts 30 days or more, even if the computer fails.
  • Be careful with Shift+Delete and with USB drives, where deletions skip the Recycle Bin.
  • Check whether auto-empty is on in the macOS Trash settings, and empty the trash only after confirming nothing important is there.

Sources