Remove a git commit which has not been pushed

前端 未结 11 722
抹茶落季
抹茶落季 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:06

    git reset --hard origin/master
    

    to reset it to whatever the origin was at.

    This was posted by @bdonlan in the comments. I added this answer for people who don't read comments.

提交回复
热议问题