This article is from the the Brief Linux FAQ (BLFAQ) Maintained by Neil Zanella email@example.com
In theory there is a way to undelete a file if you are using the ext2fs file system (most common). In practice, it is rarely possible. To prevent significant loss of data in this manner you must ensure that your system is backed up regularly. Alternatively if you had installed the program midnight commander before deleting and compiled a version with undelf then you could use cd undel:/dev/hda8 to see your deleted files (without names). Alternatively, some users like to have a shell script that moves a file to a directory like /tmp each time it is removed or just before it is overwritten. If you are really desperate, read the Ext2fs-Undeletion mini-HOWTO, which might work.