Skip to content

Instantly share code, notes, and snippets.

@jhoblitt
Last active July 28, 2022 13:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhoblitt/6bb4305e0b548e8e0de9 to your computer and use it in GitHub Desktop.
Save jhoblitt/6bb4305e0b548e8e0de9 to your computer and use it in GitHub Desktop.
Demo of needing to re-revert in order to "undo" a previous revert of a merge commit
export GIT_EDITOR=true
mkdir revert-test
cd revert-test
git init
echo "hello world" > README.md
git add README.md
git commit -m "initial commit"
git checkout -b feature/now_with_caps
echo "HELLO WORLD" > README.md
git add README.md
git commit -m "capitalize hello statement"
git checkout master
git merge feature/now_with_caps --no-ff
git checkout -b maint/remove_caps
git revert -m1 HEAD
git checkout master
git merge maint/remove_caps --no-ff
git checkout feature/now_with_caps
git rebase master
git checkout master
git merge feature/now_with_caps --no-ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment