Windows has some built-in features to protect you from accidental file deletions, but often they're not enough. For general information on file deletion in Windows, see this topic.
When you delete a file in Windows Explorer, you can immediately undelete it via the Undo Delete command. If, however, you perform another file operation after you delete the file, you're out of luck unless it's in the Recycle Bin.
The Recycle Bin:
The Recycle Bin is a special set of folders that are located in a hidden folder or file (C:\$Recycle.Bin for modern versions of Windows, C:\recycler for Windows XP and older versions).
When you (or certain Windows programs) delete a file normally, Windows copies the file data (the index entry and the contents) to the Recycle Bin folder as D<drive><#>.<extension> (for example, DC3.txt). It also writes the original name and original location of the file into a hidden index file called info2.
When you view the Recycle Bin from the Desktop or from Windows Explorer, Windows displays the original file name and location using the information in the info2 index.
If you restore a file by right-clicking it in the Recycle Bin and then clicking Restore, the file contents are copied back into the previous filename location using info2 as an index.
If you delete a file from the Recycle Bin or empty the Recycle Bin, the reference to it in info2 is deleted and the space it occupied is made available, but the contents of the file still remain on the hard drive until they are overwritten by other files.