Re-doing a reverted merge in Git

前端 未结 8 1991
一个人的身影
一个人的身影 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:41

    I would suggest you to follow below steps to revert a revert, say SHA1.

    git checkout develop #go to develop branch
    git pull             #get the latest from remote/develop branch
    git branch users/yourname/revertOfSHA1 #having HEAD referring to develop
    git checkout users/yourname/revertOfSHA1 #checkout the newly created branch
    git log --oneline --graph --decorate #find the SHA of the revert in the history, say SHA1
    git revert SHA1
    git push --set-upstream origin users/yourname/revertOfSHA1 #push the changes to remote
    

    Now create PR for the branch users/yourname/revertOfSHA1

提交回复
热议问题