how to revert git changes after commit message code example Example: git revert commit git revert <commit hash>