I'm always using git checkout <file> to unstage uncommited changes, however I can't seem to do this when files were renamed.
git just can't pickup the file I want to unstaged, tried this with no luck:
git checkout <oldfilename>
and
git checkout <newfilename>
returns error: pathspec '<file>' did not match any file(s) known to git.
Use git reset -- newfilename to unstage the renamed file.
If instead of unstaging you are looking to rename the file back, use git mv newfilename oldfilename.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With