git revert uncommitted changes single file code example
Example 1: git reset change in one file
# undo local changes to specific file
git checkout -- file
Example 2: git file reset to head
git checkout HEAD -- my-file.txt
# undo local changes to specific file
git checkout -- file
git checkout HEAD -- my-file.txt