moving committed (but not pushed) changes to a new branch after pull

后端 未结 10 1507
灰色年华
灰色年华 2020-12-22 15:51

I\'ve done a fair bit of work (\"Your branch is ahead of \'origin/master\' by 37 commits.\") which really should have gone into its own branch rather than into master<

10条回答
  •  一整个雨季
    2020-12-22 16:04

    What about:

    1. Branch from the current HEAD.
    2. Make sure you are on master, not your new branch.
    3. git reset back to the last commit before you started making changes.
    4. git pull to re-pull just the remote changes you threw away with the reset.

    Or will that explode when you try to re-merge the branch?

提交回复
热议问题