revert changes in one file git code example
Example 1: git reset change in one file
# undo local changes to specific file
git checkout -- file
Example 2: git revert one file
git checkout HEAD -- /directory/my-file.txt
Example 3: git revert commit for single file
git checkout <commit_hash> path/to/file