Created
September 25, 2019 16:07
-
-
Save rponte/8a7c95232f469a4b6fd17dfedb8b90b4 to your computer and use it in GitHub Desktop.
Git: reverting a range of commits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# 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;"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://git-scm.com/docs/git-revert
http://serebrov.github.io/html/2014-01-04-git-revert-multiple-recent-comments.html
https://stackoverflow.com/questions/4991594/revert-a-range-of-commits-in-git
https://stackoverflow.com/questions/1463340/how-to-revert-multiple-git-commits/1470452