search

Home  >  Q&A  >  body text

How to delete intermediate commits in git?

I committed twice

A was submitted first; then b was submitted. How to invalidate the submission of a?

曾经蜡笔没有小新曾经蜡笔没有小新2794 days ago576

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-02 09:28:29

    git revert a # 把commit a里的改动反过来改一遍

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-02 09:28:29

    Roll back to the one before a and resubmit b

    git reset --hard the_commit_id//id可以在你的git中看到

    reply
    0
  • Cancelreply