Question

I'm writting a php app on a windows 7 machine and I'm using git command line utility from mingw32. The problem is that I just remived a very important file of my project by mistake.

This is the command on which i didn't pay attention and disaster is on my sholders now:
rm git diff include/class/ReportBuilder.php

If I do git status I see it in:Changes to be commited but I can't find it anymore.

Do you have any idea about how can I undelete a file removed with rm from mingw32. My file was not in the repository, but I've worked 2 weeks on it :(((

Was it helpful?

Solution 2

I'm using netbeans and luckly for me, ntbeans has undelete procedure built in. Thank you Netbeans. Thank you stackoverflow for having this answer: https://stackoverflow.com/a/8179717/86112

So, the solutin is: right click on Project->History->Revert Deleted

OTHER TIPS

If the file was not tracked then this is not related to git. rm just deletes the file as usual, so you can rely only on backups.

If the file was added to the index you can try git checkout include/class/ReportBuilder.php but this won't get you the latest version, only the version from the latest git add.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top