threads / discuss / 28815

how to undo a merge

Subject: how to undo a merge

## tl;dr

2 messages between Nov 1, 2011 and Nov 1, 2011.

replies: 1people: 2as markdown or json

Hong-Ming Su· Nov 1, 2011, 07:27 UTC · lore
The commit graph before merging is:
A--B <-master
 \  \
  \  \
C--D--E--F <- dev

git checkout master git merge dev

The commit graph after merging is:
A--B
 \  \
  \  \
C--D--E--F <- dev <-master

master fast-forward to commit F. I want to "undo" the merge. What shall I do?

Thank you!

Best regards, Hong-Ming

Vincent van Ravesteijn· Nov 1, 2011, 07:56 UTC · re: Hong-Ming Su · lore

Re: how to undo a merge

Op 1-11-2011 8:27, Hong-Ming Su schreef:
Show 17 quoted lines
> The commit graph before merging is:
> A--B<-master
>   \  \
>    \  \
> C--D--E--F<- dev
>
> git checkout master
> git merge dev
>
> The commit graph after merging is:
> A--B
>   \  \
>    \  \
> C--D--E--F<- dev<-master
>
> master fast-forward to commit F.
> I want to "undo" the merge. What shall I do?

git checkout master git reset B

Vincent

← back to recent threads