how to revert a repo to the last commit code example Example: roll back last commit in git git reset --soft HEAD~1