Skip to main content
Used a more direct cross reference (as user names can change at any time). Removed the shell prompts to avoid confusion.
Source Link
Peter Mortensen
  • 31.3k
  • 22
  • 109
  • 132

Similar to Jakub's answerJakub's answer, this allows you to easily select consecutive commits to revert.

# revertRevert all commits from and including B to HEAD, inclusively
$ git revert --no-commit B^..HEAD  
$ git commit -m 'message'

Similar to Jakub's answer, this allows you to easily select consecutive commits to revert.

# revert all commits from and including B to HEAD, inclusively
$ git revert --no-commit B^..HEAD  
$ git commit -m 'message'

Similar to Jakub's answer, this allows you to easily select consecutive commits to revert.

# Revert all commits from and including B to HEAD, inclusively
git revert --no-commit B^..HEAD
git commit -m 'message'
added 15 characters in body
Source Link
klutt
  • 31k
  • 18
  • 59
  • 103

Similar to Jakub's answer, this allows you to easily select consecutive commits to revert.

# revert all commits from and including B to HEAD, inclusively
$ git revert --no-commit BB^..HEAD  
$ git commit -m 'message'

Similar to Jakub's answer, this allows you to easily select consecutive commits to revert.

# revert all commits from B to HEAD, inclusively
$ git revert --no-commit B..HEAD  
$ git commit -m 'message'

Similar to Jakub's answer, this allows you to easily select consecutive commits to revert.

# revert all commits from and including B to HEAD, inclusively
$ git revert --no-commit B^..HEAD  
$ git commit -m 'message'
Source Link
konyak
  • 11.5k
  • 4
  • 62
  • 68

Similar to Jakub's answer, this allows you to easily select consecutive commits to revert.

# revert all commits from B to HEAD, inclusively
$ git revert --no-commit B..HEAD  
$ git commit -m 'message'