我不小心在分支 "develop "中做了一些提交,而不是我的 "task'-branch"。现在,当我从develop中创建新的分支时,我总是有这些之前的提交,所以,我需要从版本库中拉出所有的develop分支,并且需要丢弃所有的本地修改和提交。所以,我需要把所有的develop分支从版本库中拉出来,并且需要丢弃所有的本地修改和提交内容。
# on your develop branch
$ git checkout develop
# create the branch you want that should have the commits in develop
$ git branch task
# force the develop branch back to its original state
$ git reset --hard origin/develop
# switch to your task branch, and continue committing
$ git checkout task