Undoing a 'git push'

前端 未结 12 1144
遥遥无期
遥遥无期 2020-11-22 13:45

Here\'s what I did on my supposed-to-be-stable branch...

% git rebase master
First, rewinding head to repla         


        
12条回答
  •  情书的邮戳
    2020-11-22 14:11

    git revert is less dangerous than some of the approaches suggested here:

    prompt> git revert 35f6af6f77f116ef922e3d75bc80a4a466f92650
    [master 71738a9] Revert "Issue #482 - Fixed bug."
     4 files changed, 30 insertions(+), 42 deletions(-)
    prompt> git status
    # On branch master
    # Your branch is ahead of 'origin/master' by 1 commit.
    #
    nothing to commit (working directory clean)
    prompt>
    

    Replace 35f6af6f77f116ef922e3d75bc80a4a466f92650 with your own commit.

提交回复
热议问题