git switch branch without discarding local changes

后端 未结 6 1080
死守一世寂寞
死守一世寂寞 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:16

    Use git stash

    git stash
    

    It pushes changes to a stack. When you want to pull them back use

     git stash apply
    

    You can even pull individual items out. To completely blow away the stash:

     git stash clear
    

提交回复
热议问题