How can I undo a `git commit` locally and on a remote after `git push`

后端 未结 7 1092
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 03:28

I have performed git commit followed by a git push. How can I revert that change on both local and remote repositories?

$ git log
         


        
7条回答
  •  有刺的猬
    2020-12-02 04:02

    Try using

    git reset --hard  
    

    Please Note : Here commit id will the id of the commit you want to go to but not the id you want to reset. this was the only point where i also got stucked.

    then push

    git push -f  
    

提交回复
热议问题