How do I delete a Git merge? -


this question has answer here:

i in bit of quandary. accidentally merged code between 2 git repositories. whatever reasons, repo names same , 1 of repo's url had changed before came know of it. ended merging code 2 different projects. here illustration repository commits.

merged repo

i have not named branches (have been working on head along). how delete 1 of commits (specifically orange one)?

you can do:

git reset --hard 628612ac 

if sure don't have in current working copy need. put head commit had before merge. nothing deleted - other commits become unreachable , garbage collected sometime in future.

another option use git-revert:

git revert -m 1 e90aeed8 

this keep history. creates new commit reverts e90ae... did.

here's read subject: https://www.kernel.org/pub/software/scm/git/docs/howto/revert-a-faulty-merge.txt

and here: http://git-scm.com/2010/03/02/undoing-merges.html


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -