Delete commits from a branch in Git

后端 未结 30 2015
醉话见心
醉话见心 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:45

    I have already pushed. Need to return some commits back remotly. Have tried many variations, but only this from Justin via git bush is working fine for me:

    git reset --hard $GIT_COMMIT_HASH_HERE
    git push origin HEAD --force
    

提交回复
热议问题