Reputation: 131
I'm facing a situation where I have accidentally done a git rm foo.c
before committing it even once. So, it was completely untracked by git and yet the file was physically deleted.
I have already tried git reset --hard
and git checkout .
, but they both don't seem to work.
Any suggestions before I restart the arduous task of rewriting that file?
Upvotes: 2
Views: 1630
Reputation: 6079
If a file is not tracked, git can't help you. That's the only requirement git has: you need to track files. It's not git's mission to watch ("track") untracked files.
You need to recover your file with some other method.
Upvotes: 3