If you’re like most people, the most valuable thing about your PC is the wealth of personal and often irreplaceable data stored on its disk. From family photographs and videos through emails and household accounts to reports and presentations for work, losing any of these files would be time-consuming at the best and gut-wrenching at the worst.

Yet it’s so easy to make a mistake. All it takes is one press of the Delete key and your valuable data could be consigned to oblivion. And it gets worse. Spinning at 7,200 rpm for eight or more hours per day, it’s a minor miracle that hard disks are so reliable. Yet nothing is immune from failure and if your disk does suffer a crash it could take all your data with it. Even something as apparently innocuous as a power failure could wreak havoc if Windows was writing to your disk at the time.

See also: How to undelete files using Disk Digger

Before you get too depressed at the prospect of impending doom, we have good news. Even though Windows may not be able to see a file that you deleted accidentally or was the victim of a disk failure, it’s quite possible that the data could still be there. And if it is still present, there are several ways of getting it back as we'll explain.

Recovering files in Windows

Chances are that you’re well aware of Windows' Recycle Bin, but even if you're not, it's the first place to look 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.

Recycle bin

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.

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 genuinely be deleted. 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.

If you're in the habit of deleting files by holding down the Shift key while you press Delete or select Delete from the pull-down menu, files are actually deleted instead of being moved to the Recycle Bin. Similarly, if you choose to empty the Recycle Bin by right-clicking on it and selecting Empty Recycle Bin, the files will be deleted and no longer available in Windows.

However, the word delete is something of a misnomer here. Details differ depending on which file system is used (hard disks often use a different format from flash drives, for example) but essentially all that happens when Windows deletes a file on the hard disk is that the Master File Table (a special system file that Windows uses to keep track of which physical areas of the disk are occupied by each file) is modified so that the areas of the disk occupied by the deleted file are marked as available for reuse.

It should come as no surprise, therefore, that a software utility capable of delving into the Master File Table should be able to restore the 'deleted' files. There are plenty of programs which can do this including Disk Digger and PC Inspector File Recovery.

Disk digger

However, things aren’t always plain sailing so it pays to understand the limitations. First of all, if the areas of the disk previously occupied by the file are marked as available for reuse, Windows will eventually overwrite them with new files and, once that’s happened, your data is gone for good.

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 until after you’ve tried to 'undelete' it. Remember that even installing a file recovery utility involves writing to the disk so it pays to have suitable software already installed as a precaution.

Failing this, look for some software that you can run directly from a USB flash drive so that downloading and installing it doesn’t inadvertently overwrite the portions of the hard disk that contains your missing data. Even browsing the Web to find an undelete utility causes files to be written to your disk so, if possible, use a different PC to download the utility.

Second, 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.

Third, 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 usually use some variant of FAT (FAT16, FAT32 or exFAT) and you should select software with the necessary support for all your media.

NAS drives

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.

So long as 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.

Next page: recovering corrupt files and from damaged hard drives