Throw away local commits in Git

前端 未结 20 1730
遥遥无期
遥遥无期 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 03:56

    If you just want to throw away local commits and keep the modifications done in files then do
    git reset @~
    Other answers addressed the hard reset

提交回复
热议问题