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

后端 未结 7 1148
隐瞒了意图╮
隐瞒了意图╮ 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

    git reset HEAD~1 if you don't want your changes to be gone(unstaged changes). Change, commit and push again git push -f [origin] [branch]

提交回复
热议问题