I accidentally removed 3 files from both git and my working directory with
git rm -f [file]
when I was only trying to get git to ignore them. Is there any way to undo this command? The files have been changed since my last commit.
I accidentally removed 3 files from both git and my working directory with
git rm -f [file]
when I was only trying to get git to ignore them. Is there any way to undo this command? The files have been changed since my last commit.
Since you used -f
, there should be no way in git to get them back.
But: if you didn't yet reset the files to a former version, there's a good chance that the actual data still resides on your hard disk.
You can use a software that scans your drive for deleted but recoverable files. There should be some of those programs for each major OS. On Windows I successfully used Undelete360 but there are also other options.