Git reset and checkout by single command
Consider I’ve staged for committing a file (e.g.
db/schema.rb) that I didn’t intended to change. I need to do:
git reset db/schema.rb git checkout db/schema.rb
Can I do it by single command?
2 Solutions collect form web for “Git reset and checkout by single command”
I tried this one and works well for me:
git checkout HEAD -- path
Simply reset with option
git reset --HARD