This site runs best with JavaScript enabled.

GIT Revert

Kevin Beck

December 21, 2020

To jump back to a previous commit hash.

"The --no-commit flag lets git revert all the commits at once- otherwise you'll be prompted for a message for each commit in the range, littering your history with unnecessary new commits." -

"If you really do want to have individual commits (instead of reverting everything with one big commit), then you can pass --no-edit instead of --no-commit, so that you don't have to edit a commit message for each reversion." -

git revert --no-commit 1234567..HEAD
git commit

This way will not destroy any history so can can used for public commits.