Re-doing a reverted merge in Git

前端 未结 8 2180
一个人的身影
一个人的身影 2020-11-22 11:10

I have run into a bit of a problem here: I had a problem-specific branch 28s in Git, that I merged in the general develop branch. Turns out I had d

8条回答
  •  日久生厌
    2020-11-22 11:54

    I just found this post when facing the same problem. I find above wayyy to scary to do reset hards etc. I'll end up deleting something I don't want to, and won't be able to get it back.

    Instead I checked out the commit I wanted the branch to go back to e.g. git checkout 123466t7632723. Then converted to a branch git checkout my-new-branch. I then deleted the branch I didn't want any more. Of course this will only work if you are able to throw away the branch you messed up.

提交回复
热议问题