Recover you python files from rm -rf *

So after cleaning up my work i run rm -rf * in the woring folder. Deleting all my work!.
After fighting holding back some tears I set down and start see if i could recover my lost work.

First recover you file from the filesystem and my laptop is an ubuntu desktop

sudo apt-get install extundelete

Then its time to recover the files i run this command to get my lost folder back

sudo extundelete --restore-directory /home/mattias/myfiles /dev/mapper/ubuntu--vg-root

Now the magic happend and i got my files back BUT ONLY MY .pyc files !
so for getting back my original files i downloaded

https://github.com/wibiti/uncompyle2

unzip the folder and run

python setup.py install

Then to get my python file back run


 uncompyle2 fabfile.pyc



And the file is BACK if you read this and have now backup fix it now!

Next post will problebly be a backup post so read that one.