Git: Discard all changes on a diverged local branch

后端 未结 2 1340
无人共我
无人共我 2021-01-29 20:03

I have a local topic branch that\'s tracking a remote branch. For the sake of argument, say the commit histories look like this:

A--B--C--O1--O2--O3 (origin/phob         


        
2条回答
  •  独厮守ぢ
    2021-01-29 20:21

    Delete the branch, then re-create it:

    $ git branch -D phobos
    $ git checkout --track -b phobos origin/phobos
    

提交回复
热议问题