git revert file change to HEAD code example Example: git reset one file git checkout HEAD -- my-file.txt