Skip to content

Instantly share code, notes, and snippets.

@ptrv
Created June 18, 2009 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptrv/131986 to your computer and use it in GitHub Desktop.
Save ptrv/131986 to your computer and use it in GitHub Desktop.
# create and check out a temporary branch at the location of the bad merge
git checkout -b tmpfix <sha1-of-merge>
# remove the incorrectly added file
git rm somefile.orig
# commit the amended merge
git commit --amend
# go back to the master branch
git checkout master
# replant the master branch onto the corrected merge
git rebase tmpfix
# delete the temporary branch
git branch -d tmpfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment