Delete commits from a branch in Git

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

    git reset --hard HEAD~1
    You will be now at previous head. Pull the branch. Push new code. Commit will be removed from git

提交回复
热议问题