Skip to content

Instantly share code, notes, and snippets.

@rponte
Created September 25, 2019 16:07
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rponte/8a7c95232f469a4b6fd17dfedb8b90b4 to your computer and use it in GitHub Desktop.
Save rponte/8a7c95232f469a4b6fd17dfedb8b90b4 to your computer and use it in GitHub Desktop.
Git: reverting a range of commits
##
# Reverting a range of commits
#
# git --pretty=oneline --abbrev-commit older_commit..newer_commit # not includes the oldest commit
# git --pretty=oneline --abbrev-commit older_commit^..newer_commit # includes the oldest commit
##
# just to be sure about the commits, list them
git log --pretty=oneline --abbrev-commit 1f80548^..4b293d5
# now, let's revert all commits
git revert --no-commit 1f80548^..4b293d5
# then let's commit all of them with a single message
git commit -am "[RELEASE_FIX] this feature should not be here now;";