How to restore deleted files? [duplicate]

Solution 1:

1.) Recovery from backups

There are two kinds of people: Those, who make backups - and those, who wish they had made backups.

This is an important rule to follow. If you have data, which you can't afford to lose, then you need to make backups of them. If you have backups, then it's easiest to just recover from a backup.

If you have not made a backup yet, then it's too late for the files you already have deleted, but not for all the files you still have. So make a backup of those ASAP.

2.) Professional Data Recovery

Depending on the value of the data, you may have good chances of success with professional data recovery. Turn your device off and keep it turned off!

Contact a professional, explain the situation and ask them for a quote. Keep in mind, they cannot guarantee that they will be able to recover your data, but depending on how valuable it is to you, this may be a viable option.

3.) Recovery Software

If professional help isn't an option, you can still attempt to recover it yourself. Create an image of the partition you have made and write it to an external(!) drive. Don't write it to the same partition your data was on, because you risk overwriting the same data you are trying to recover.

To do that, run the following command:

sudo dd if=/dev/sdXY of=/media/<External>/recovery_image.iso bs=4M status=progress

X and Y are the letter and partition used for your device. For example, if your data partition is /dev/sda3, then write if=/dev/sda3. is the mount point of your external drive.

Afterwards, you have a bit-for-bit copy of your data partition. If your files are still there, you can now attempt to recover them with any available tool.

There are many available, both for Linux and Windows, and you can try multiple. As they all work off the same image file, if one of them succeeds, then you're in luck.