I have just copied a file main.tex from /path_1/ to /path_2/:
cp path_1/main.tex /path_2 path_2 already contained main.tex, so it has been overwritten.
Is there a way to recover the original main.tex file located in path_2?
I have just copied a file main.tex from /path_1/ to /path_2/:
cp path_1/main.tex /path_2 path_2 already contained main.tex, so it has been overwritten.
Is there a way to recover the original main.tex file located in path_2?
Standard unix commands do not have any such option.
You will need to restore the file from backup.
In the future, you might want to consider
alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' in your .bashrc . This will warn you before overwriting an existing file.
https://github.com/PabloLec/RecoverPy This tool solved by issue I accidentally saved the file empty... When I reopen file it was empty.
This tool can scan blocks in your drive using a keyword. This tool is specially made to recover overwritten files content not your typical deleted file. But content that is still saved on blocks in your drive.
How to use:
This tool is amazing since I manage to recover a file with nearly 4000 lines... It was my notes for some research I have been doing. (Yes I should had made a backup) and I learned my lesson and now the file is online.