When you a delete a file, it is not erased/deleted permenently from the drive unless we clean by emptying the recycle bin
Operating Systems keep track of where files are on a hard drive using “pointers.” Each and every file/folder on the hard disk has a pointer that specifies where the file’s data begins and ends.So when we delete a file, Operating System removes the pointer and marks the sectors containing the file’s data as available in other words free memory . From the file system’s point of view, the file is no longer present on your hard drive.
So untill we write new data to the sectors ,the deleted data will still remain in that sector.
A file recovery program can scan a hard drive for these deleted files and restore them.IF a portion of the entire file has been overwritten, then the file cannot be recovered completely.