If you accidently deleted a text-file, you might be able to recover it using grep:
$ grep --binary-files=text --context=x 'stringfromyourfile' \
/dev/whateverPartition > someFile.txt
x are the lines before and after the string.
I found this idea on this blog.