How do I delete unpushed git commits?

前端 未结 7 1105
轮回少年
轮回少年 2020-11-28 16:45

I accidentally committed to the wrong branch. How do I delete that commit?

7条回答
  •  情深已故
    2020-11-28 17:39

    Following command worked for me, all the local committed changes are dropped & local is reset to the same as remote origin/master branch.

    git reset --hard origin

提交回复
热议问题