Antje Janosch
Antje Janosch

Reputation: 1194

Howto undo weird merge commit

I made a weird mistake (a merge commit done with SmartGit) and now origin/branch1 does point to that merge commit instead of the commit the remote repo branch1 indeed points to. is there any way to move origin/branch1 back to where it points in the remote repo?

No further answer required - I misunderstood the status of my local repository (don't know if this requires any action to close or delete this question as there is no answer if the question itself is wrong)

Upvotes: 1

Views: 40

Answers (1)

hek2mgl
hek2mgl

Reputation: 157967

Use

git reset --hard HEAD~1

to move origin/branch1 back to the previous commit. (Use ~2,~3 and so on if you want to reset more commits, this is not fully clear in your question)

Then use rebase instead of merge to integrate the changes of the other branch - without merging:

git rebase other_branch_name

Upvotes: 1

Related Questions