It is sometimes possible to recover an file deleted by accident. Stop using the disk, check your recycle bin, and perhaps pull out an undelete utility.
I think anyone who’s used computers for any length of time has been where you are now. I know I’ve been there on more than one occasion.
The answer to your question is really, “maybe”. It depends on a lot of things.
Stop – just stop
First, and this is important, stop using the disk that had the file.
I’ll explain why in a second, but to increase the likelihood that the file can be recovered, stop doing things that might write to the disk. That even means leaving your programs running – since many will write to the disk as they exit – and it means do not browse the internet, since the browser will write it’s history do disk. (Unless, of course, you know that the file was on a different disk than the operating system or other items.)
Now, first things first – look in the recycle bin. If you deleted the file using Windows Explorer, or many of the standard Windows controls, the file might not actually be deleted – just moved into the Recycle Bin. If that’s the case, you can simply move it back out of the Recycle Bin to wherever you wanted it to be. Do move it out, because if the Recycle Bin is emptied then the file is truly deleted, and things get harder, as we’ll see next.
If your file wasn’t recycled, perhaps because you deleted it in a Command Prompt, some other program deleted it, or you were holding the SHIFT key down when you deleted it in explorer, the file has really been deleted. However, the contents might still be recoverable.
Deleting does not, by default, overwrite the data in your file. All it really does is say “OK, this disk space over here, that used to be a file? You can use it for other things now.” The contents of the file actually doesn’t disappear until it’s been overwritten by something else. That’s why it’s so important to stop doing things to the disk that contained the file. Any writing to the hard disk after you’ve deleted a file could overwrite it’s contents.
There are a lot of “undelete” utilities available. A Google search on “undelete files” returns a long list of utilities. I currently recommend Recuva which will scan your disk and display all the files that could possibly be recovered.
Whatever tool you use make sure that the undelete utility supports the format of your disk (NTFS, FAT or FAT32 - running “chkdsk” in a command prompt will tell you).
Remember I said don’t write to the disk? That probably means you’ll need to search for, and download, an undelete utility using a different computer entirely, and use a floppy or CD-ROM to take it to the computer experiencing problems.
If you’ve not done anything to the hard disk since the file was deleted, the undelete utility should find it and be able to recover it for you. If you have been using the disk, then it’s an unpredictable roll of the dice. It depends on how much has been written to the disk, where on the disk it was written, and where on the disk your now-deleted file used to reside. It might work. It might not.
The big (expensive) guns
There is one, last, hope – but it’s expensive, potentially time consuming, and really only for the most dire of circumstances. It is sometimes possible, using advanced data recovery techniques, to recover data even after it’s been overwritten. It requires special equipment and special techniques, so you’d be sending your hard drive to a data recovery service.
And you’ll be writing a fairly large check.
There are many factors involved, and it’s definitely not as easy as you might see on TV, but it can, sometimes, be done.
Prevention is so much easier than the cure
My ultimate recommendation? Regular backups. This situation happens to me often enough that I have been able to save hours of valuable time by simply recovering a deleted file from my regular backups.