revert single file git code example
Example 1: git revert one file
git checkout HEAD -- /directory/my-file.txt
Example 2: git undo all changes
git reset --hard
Example 3: git reset one file
git checkout HEAD -- my-file.txt
Example 4: git revert commit for single file
git checkout <commit_hash> path/to/file