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