git switch branch without discarding local changes

后端 未结 6 1079
死守一世寂寞
死守一世寂寞 2020-11-30 16:48

Alright, lets say one day we make happen to make a bunch of modifications and when we go to commit them we notice we were working on the wrong branch.

How can we for

6条回答
  •  孤独总比滥情好
    2020-11-30 17:29

    You can either :

    • Use git stash to shelve your changes or,

    • Create another branch and commit your changes there, and then merge that branch into your working directory

提交回复
热议问题