Delete commits from a branch in Git

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

    Removing an entire commit

    git rebase -p --onto SHA^ SHA
    

    Obviously replace "SHA" with the reference you want to get rid of. The "^" in that command is literal.

    http://sethrobertson.github.io/GitFixUm/fixup.html#change_deep

提交回复
热议问题