misc:recover_a_file_that_you_ve_copied_sth._over
On Ubuntu :
SE Link for the detailed solution : https://unix.stackexchange.com/questions/149342/can-overwritten-files-be-recovered
In short, use the following command :
grep -i -a -B100 -A100 'text in the deleted file' /dev/sda1
or
grep -i -a -B100 -A100 'text in the deleted file' /dev/sda1 &> found.txt
B100 and A100 looks for 100 lines before and after your 'text in the deleted file'. You have to remember something specific from the file you've lost. (a unique class, function or variable name?)
Be careful it may find the older versions of the file, make sure it is up to date with the file you've lost.
misc/recover_a_file_that_you_ve_copied_sth._over.txt · Last modified: 2023/01/11 21:32 by bargun2