One of my friends was working on a 10 page college paper, and saved it in the tmp folder of ubuntu. The file is listed under LibreOffice Writer's "recent files" but when clicked on, it comes up with an error that says "this file does not exits." I am guessing that the problem is that all tmp files are deleted to save space, but I was wondering if there was a way to restore it.
If the file you're after has been deleted, the blocks that the data is stored on are in danger of being overwritten. Once that happens, you're not getting it back.
Ideally, you'd remount the partition the file was on read only immediately to prevent that. Check this guide.
If remounting is not an option, you probably want to consider shutting the system down. That will generate disk write activity that could kill the file, but so will leaving the system up long enough, even if nobody is logged in.
Once you've got the system shut down, you can boot it off a USB drive or optical media and try and recover the file. Something with extundelete on it would be ideal. Check out the Ubuntu Rescue Remix.
Even if you can't get the whole file back, you might get some text fragments back by grepping the raw device file.
If you're running Linux, you may be able to use testdisk, which comes bundled with photorec. I didn't think it would work, but it recovered my .odt document saved in the /tmp file.
(Then follow the prompts)
See original reference: http://ubuntuforums.org/showthread.php?t=1352636