revert commit of one file git code example
Example 1: git revert one file
git checkout HEAD -- /directory/my-file.txt
Example 2: git revert commit for single file
git checkout <commit_hash> path/to/file
git checkout HEAD -- /directory/my-file.txt
git checkout <commit_hash> path/to/file