Git: move changes off of master branch

后端 未结 6 460
南旧
南旧 2021-02-03 20:53

Basic question but this happens to me all the time:

  • Make changes in a working-branch
  • Switch to master
  • git merg
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-03 21:20

    I used for similar cases:

    git branch -f 
    git checkout 
    

    or

    git checkout -B 
    

    .

    Both variants move the branch branch-name to your current commit with out reseting-hard your tree.

提交回复
热议问题