Depending on the operating system, we can download Testdisk from its website.

Once downloaded, we go to the terminal, access the folder and run:

./photorec_static (root required)

or in my case (when opening the program we will need root):

wget http://www.cgsecurity.org/testdisk-7.0-WIP.linux26-x86_64.tar.bz2
tar xvzf testdisk-7.0-WIP.linux26-x86_64.tar.bz2
cd testdisk-7.0-WIP.linux26-x86_64

./photorec_static

for more information, visit: http://www.cgsecurity.org/wiki/TestDisk_Paso_A_Paso