How you deleted a file by mistake that you must desperately recover ?
I had and I searched around a way to recover that file, and many more, through terminal, because let's face it. When you are in black screen your options and knowledge is limited.
My suggestion in scalpel.
sudo apt-get install scalpel
to install the package.
The configuration file is the
where you must uncomment the type of files that you wish to recover. Once you have them uncommented,
sudo scalpel <partition>
sudo scalpel /dev/sda1 -o /home/user/recovered.
I recommend creating a directory, since is must be empty.
The whole process will take a while, since it goes through each block of the partition in the HDD, but it worths the time.
Advanced readers are encouraged to look up more here.