Skip to content

Instantly share code, notes, and snippets.

@adufilie
Last active April 15, 2016 18:24
Show Gist options
  • Save adufilie/3c1424e86116fbe63f4d5d14f1644759 to your computer and use it in GitHub Desktop.
Save adufilie/3c1424e86116fbe63f4d5d14f1644759 to your computer and use it in GitHub Desktop.
Reverting a bad merge and salvaging the files that were correct
$ git checkout develop
$ git log --merges
commit 35ecc98fc82ef812ace78ea03fec5cbe49e74c54
Merge: 4b55b79 a921fbc
Author: foobar <foo@bar.com>
Date: Thu Apr 14 17:45:54 2016 -0400
Merge branch 'develop' of https://github.com/WeaveTeam/WeaveJS into develop
Conflicts:
srcts/editors/BinningDefinitionEditor.tsx
srcts/tools/FixedDataTable.tsx
a921fbc was the last good commit
go back to the bad merge
$ git reset --hard 35ecc98
revert the bad merge with -m 2 to use a921fbc as mainline
$ git revert -m 2 35ecc98
salvage the few files that were correct after the bad merge
$ git checkout 35ecc98 -- srcts/tools/AttributeMenuTool/AttributeMenuTool.tsx
$ git checkout 35ecc98 -- srcts/react-ui/RCSlider
build and test, then commit after it is verified to work
$ git commit -am "salvaging files that were correct in 35ecc98"
pull changes without -r because we want to have the effect of inserting the merge revert and salvage into the history
$ git pull origin develop
push the fixes
$ git push origin develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment