Delete commits from a branch in Git

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

    git reset --hard

    git push origin HEAD --force

    If one or more of the commits is tagged, delete the tag(s) first. Otherwise the tagged commit is not removed.

提交回复
热议问题