Delete commits from a branch in Git

后端 未结 30 2005
醉话见心
醉话见心 2020-11-21 07:17

I would like to know how to delete a commit.

By delete, I mean it is as if I didn\'t make that commit, and when I do a push in the future, my changes wi

30条回答
  •  温柔的废话
    2020-11-21 07:43

    What I do usually when I commit and push (if anyone pushed his commit this solve the problem):

    git reset --hard HEAD~1
    
    git push -f origin
    

    hope this help

提交回复
热议问题