Undo git rm -f [file]

I accidentally deleted 3 files from git and my working directory with

git rm -f [file]

      

when I was only trying to get git to ignore them. Is there a way to reverse this command? The files have changed since the last commit.

+3


source to share


1 answer


Since you used -f

, there shouldn't be a way in git to get them back. But: if you haven't reset the files to a previous version yet, there is a good chance the actual data is still on your hard drive .



You can use software that scans your drive for deleted but recoverable files. There should be some of these programs for every major OS. On Windows I have used Undelete360 successfully , but there are other options as well.

+1


source







All Articles