git revert commit and add changes to working tree code example Example: git revert commit git revert <commit hash>