Undoing a 'git push'

前端 未结 12 1096
遥遥无期
遥遥无期 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:13

    Undo multiple commits git reset --hard 0ad5a7a6 (Just provide commit SHA1 hash)

    Undo last commit

    git reset --hard HEAD~1 (changes to last commit will be removed ) git reset --soft HEAD~1 (changes to last commit will be available as uncommited local modifications)

提交回复
热议问题