There is a way to un-delete a file if a program has it open in Linux.
How directory entries work in Unix
When you remove a file on Linux, what actually happens is that the file is unlinked. Lets have a look. I start with a clean directory:
The directory has two entries, the current directory and the parent directory. The second entry, the number (2 and 14 above), is the number of links to the file. The current directory has 2 links, one for it’s entry in itself ‘.’ and one for its entry in the parent directory. If we create a file, it has one link: