Accidentally deleting files is easy to do. It's a sickening feeling when you realise what you've done. Fortunately, you might be able to get them back without spending any money.

Even though Windows may not be able to see a file you accidentally deleted - or perhaps became the victim to a disk failure - it’s usually possible that the data could still be there and able to be retrieved.

Many free programs attempt to recover deleted files, but you need to be careful before installing and using them (we'll explain why below). Here we're using Disk Digger, but most file recovery utilities work the same way, and we'll recommend some alternatives if this doesn't work for you.

• Download Disk Digger, extract the contents of the Zip folder and run the .exe file

• Select the disk containing your deleted files and click Next. Allow the tool to scan for missing files

• Check the list and preview images of returned files for your deleted document or media

• Select your file and click Recover selected files

• Choose a save location, which must be different to the original location

For more in-depth instructions jump to our walkthrough on how to undelete files.

Look in the Recycle Bin for deleted files

The first thing you should do is check the Windows' Recycle Bin if you've just deleted something you didn't mean to. When you select a file and press the Delete key (or right-click and choose the Delete option from the menu), Windows makes no attempt to delete it at all.

Instead, it moves it to a special folder called the Recycle Bin, which has its own icon on the desktop. Restoring a file from the Recycle Bin is a simple matter of double-clicking on the desktop icon to display the contents and then right-clicking on the file and selecting Restore from the menu.

If the Recycle bin icon is not there, search in the Start menu for 'Show or Hide' and you should see a shortcut to the settings where you can tick the box next to the Recycle Bin and make it appear.

Don't rely on the Recycle Bin as a safety net, though: it has a size limit and once you exceed that, older files will be deleted permanently and automatically. The default size is more than adequate for most people so there’s a very good chance that any files you want to restore will still be present in the Recycle Bin.  To check the capacity or alter it, right click on the Recycle Bin and choose Properties.

There are occasions when you've emptied the Recycle Bin too hastily, or perhaps you're overly fond of the Shift-Delete shortcut which bypasses the Recycle Bin and actually deletes the data. (We're still tying to wean ourselves off this unhelpful habit.)

if your files were on an SD card or USB flash drive there is no Recycle Bin function, so delete really is delete in this case.

But before resorting to file recovery software, it is still worth checking other avenues. Have you shared the file or document via email? Have you saved or synchronised it with a cloud storage service? Or have you been sensible and made a backup of the files on another hard drive?

No? Well fear not, because there are plenty of programs including Disk Digger and PC Inspector File Recovery which might be able to bring them back.

How to recover deleted files

There are lots of others too:

Recuva

Paragon Rescue Kit 14 Free

CGSecurity PhotoRec

Minitool Partition Wizard Free Edition 9.1

Undelete a file using recovery software

Undelete software works by looking on the disk to see if the data is still there, even after a 'permanent' deletion.

All Windows really does when it deletes a file (permanently) is scrubs out the information about where it was stored on the disk. It's a bit like crossing out the address on an envelope: the contents are still in it, but a postman wouldn't know where to deliver it.

However, it pays to understand the limitations of this method. First of all, as well as removing the 'pointer' to the file, Windows also marks the areas of the disk occupied by the file as available for re-use and will eventually overwrite them with new files. Once that’s happened, your data is gone for good.

So, the sooner you realise you’ve accidentally deleted a file, the better your chances of recovering it. When you notice your loss, don’t save anything to the disk and don't even download or install a file recovery utility if the file was on your PC or laptop's hard drive as it might overwrite the very files you're trying to recover.

Some recovery software can run directly from a USB flash drive but you must download it using a different computer. Even browsing the internet to find an undelete utility causes files to be written to your disk so use a different PC to download the utility.

Undelete utilities only work reliably with sequential files. If your disk is reasonably full, Windows often has to split the file across spare blocks around the disk and in this case, a deleted file is very difficult to recover.

Plus, different types of drive use different file systems and any undelete utility will work only with particular types of file system. Hard disks in Windows PCs use the NTFS file system but USB flash drives and memory cards usually use some variant of FAT (FAT16, FAT32 or exFAT) and you should select software with the necessary support for all your media.

Undeleting files from a NAS drive

Another drawback with most undelete utilities is that they won’t work with networked storage, i.e. NAS drives. The disk(s) in a NAS drive are under the control of the drive’s own operating system (usually a Linux variant) so software running under Windows isn’t typically able to attempt a recovery.

If you’ve accidentally deleted a file it might just be in the NAS drive’s own recycle bin (if enabled) in which case you might be able to recover it, so first check the documentation. If the file is properly deleted, though, there are only two options:

Provided you don’t mind getting to grips with the insides of the NAS drive and your PC, it might be possible to remove the disk(s) from the NAS and attach them directly to your PC. Now it becomes possible to use a Windows undelete utility, but with two provisos.

First, your NAS drive might use a different file system from the drive in your PC so you’ll have to check the NAS drive’s documentation to select suitable software. Second, if your NAS drive uses a RAID array, your file might be distributed between more than one physical disk.

Some recovery software is able to handle RAID arrays but, again, you need to bear this in mind in making your selection. If you don’t fancy dismantling your NAS drive and selecting suitable software, the other option is to send your array off to a professional data recovery company.

Recovering corrupt files

Another way files can be lost is if they become corrupted. This could happen, for example, if a power failure occurred while a file was being written, leaving the disk directory in an unpredictable state.

As with accidentally deleted files, the data could all be there but Windows wouldn’t know where to find it. Often this sort of problem will manifest itself by Windows reporting some sort of error when you try to open a file or, conceivably, files could just have disappeared, even though you’re pretty sure you hadn't deleted them.

Software utilities are available to identify and correct this sort of error and you’ll find that some undelete products also offer the ability to recover from logical errors in the file system. While some pure undeletion utilities are free, you’ll often have to pay for those more fully featured products.

Some let you try before you buy, though. With RecoverMyFiles, for example, you can download the software in evaluation mode and run it to see what files it can recover from your disk. If you like what you see, you pay a fee to allow those files to be permanently recovered.

An exception to the rule that you get only what you pay is TestDisk which is free and open source and has earned a good reputation. It’s available for Windows, Linux and MacOS.

Whatever software you use, though, as with pure undeletion packages, don’t install it to the offending disk as doing so could render your lost data permanently unrecoverable.

Also bear in mind that packages will differ in their ability to recover lost data. It would be a good idea, therefore, to try out several (so long as they have an evaluation mode which will show what they’re able to recover without actually writing to your disk) and choose whichever has the best success.

Alternatively, if you don’t find any software that meets your needs, the option of using a data recovery service is always available, but it isn't necessarily a cheap option.

Recovering files from a broken hard drive

Having dispelled the myth that deleted and corrupted files are lost forever, we now come to the problem that all PC users dread - a hard disk failure. This could manifest in several ways but generally Windows won’t start, even in Safe Mode, and turning on your PC might be accompanied by unhealthy clicking noises. What you stand to lose, therefore, isn’t just a few of your treasured files but the entire contents of the disk.

It’s commonly suggested that hard disks can be repaired by putting them in the freezer. While this has been known to work, bringing the drive back to life for just long enough to extract the most important files, it’s effective only for certain very specific types of fault.

Often it won’t work and attempting it might just prove to be the last straw for your ailing disk. Our recommendation, therefore, is that you don’t attempt this nor any other DIY repair.

Instead, as soon as you suspect a hardware failure, turn off your PC immediately and make contact with a data recovery company such as Kroll OnTrack. These companies have vast stocks of parts that they are able to swap in their clean room to restore a disk to a working state.

Once this has been achieved they’ll copy all the data they can recover to encrypted removable media such as a USB drive. This will work for failures of most parts of the disk including the electronic circuit boards, the motor and the read/write head, but there’s a limit to what can be achieved.

Kroll OnTrack

As the part on which the data is actually stored, if the platter is scratched or shattered it’s normally game over although, fortunately, this is rare. As always, it pays to shop around before deciding which company to use and it’s also a good idea to choose a company that will diagnose the problem for free.

As guidance, though, if you were to go to Kroll OnTrack, you’d pay a fixed fee of £599 including VAT as a consumer, whereas charges for businesses depend on exactly what’s involved.

How to use Disk Digger

Step 1. Download Download Disk Digger. You don’t need to install it – just extract the contents of the .zip archive and run the .exe file. Remember that if you’ve already accidentally deleted some files, you shouldn’t download DiskDigger to the disk containing your lost files as it could overwrite your files and make it impossible to recover them. Ideally, download it before you actually need it.

Step 2. Start DiskDigger. The opening screen shows all the disks so select the one containing your deleted files and click on ‘Next’ three times. The disk will now be scanned and any deleted files will be listed – this could take some time. If your missing files are listed, continue to the next step. If not you could try altering some of the options in the earlier screens.

Scan disks

Step 3. DiskDigger won’t be able to show correct filenames so, to help identify lost files, a preview option is provided. Select a file in the list at the left and choose either the ‘Preview’ (for photos) or the ‘First few bytes’ tag. Also useful for photographs is the ‘Thumbnail’ option in the ‘View’ menu which will show small images in the list.

Preview files

Step 4. When you’ve identified your lost file(s) select them in the list at the left and click on ‘Recover selected files…’. Next select the device and folder where you want your files to be restored to (this must not be on the same physical drive as the lost file) and click on OK. The missing file(s) will be saved with automatically generated filenames, so you’ll need to rename them to their original names or something meaningful. (See also: How to erase a write-protected USB drive or SD card.)

Save recovered files