I did a git rm somefile
and I wish to just undo it. Is there a way to do that?
In other words I just want to restore that one file and everything else should stay the same.
I did a git rm somefile
and I wish to just undo it. Is there a way to do that?
In other words I just want to restore that one file and everything else should stay the same.
You can just do this, If you have not committed yet.
git checkout somefile
If you have already committed, then you can only get the file from previous commit. That can be done by:
git checkout HEAD~ somefile