September 22, 2015

TIL: How to revert multiple Git commits at once

The problem

You want to revert multiple commits at once, but git revert accepts just one commit id.

The solution

Use git revert --no-commit <commit> for each commit which you want to remove and when you are done commit your changes with standard git commit command.

Hey there!

My name is Patrik Bóna and I am the only programmer at Memberful. This blog is kind of dead, but I just started my own Ruby on Rails screencast. Follow me on Twitter if you want to be notified about my newest videos.