how to revert a single file commit in git code example Example: git revert commit for single file git checkout <commit_hash> path/to/file