Bulk Reverting Commits (Git)

Usually, you only want to revert a single commit at once. Just occasionally, though, you want to revert multiple commits all in one fell swoop (making it either a very sad or a very happy day).

Details

  • Language: Git

Snippet

git revert --no-commit [commit ref1]
git revert --no-commit [commit ref2]
git revert --no-commit [commit ref3]
git commit -m "Ripping out those rubbish changes"

Usage Example

git revert --no-commit c793d776
git revert --no-commit 81e71c8c
git revert --no-commit 8ca16d12
git revert --no-commit f698c756
git commit