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

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

    You can do an interactive rebase:

    git rebase -i 
    

    This will bring up your default editor. Just delete the line containing the commit you want to remove to delete that commit.

    You will, of course, need access to the remote repository to apply this change there too.

    See this question: Git: removing selected commits from repository

提交回复
热议问题