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

Recovering corrupt files

So far, we've talked about recovering accidentally deleted files but files can also be lost due to the disk’s file structure becoming 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.

Hard disk failure

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.

Optical discs

Although data normally can’t be recovered if a hard disk’s platter is scratched, the same isn’t necessarily true of optical discs such as CDs and DVDs. So long as the scratch is only in the plastic protective layer and not the underlying data storage layer, chemical formulations and mechanical polishing machines are available to help repair your disk. Digital Innovations’ SkipDR, for example, costs £14 from PC World.