unstage a file in git without lossing changes code example Example: how to unstage a commit git reset HEAD~