Remove a git commit which has not been pushed

前端 未结 11 734
抹茶落季
抹茶落季 2020-12-04 04:34

I did a git commit but I have not pushed it to the repository yet. So when I do git status, I get \'# Your branch is ahead of \'master\' by 1 commi

11条回答
  •  臣服心动
    2020-12-04 05:10

    Simply type in the console :

    $ git reset HEAD~
    

    This command discards all local commits ahead of the remote HEAD

提交回复
热议问题