Throw away local commits in Git

前端 未结 20 1715
遥遥无期
遥遥无期 2020-12-02 03:08

Due to some bad cherry-picking, my local Git repository is currently five commits ahead of the origin, and not in a good state. I want to get rid of all these commits and st

20条回答
  •  一向
    一向 (楼主)
    2020-12-02 04:05

    Simple Solution will be to match local master branch HEAD to origin/master branch HEAD

    git reset --hard origin/master
    

    PS: origin/master - is remote pointer to master branch. You can replace master with any branch name

提交回复
热议问题