git switch branch without discarding local changes

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

    • git stash to save your uncommited changes
    • git stash list to list your saved uncommited stashes
    • git stash apply stash@{x} where x can be 0,1,2..no of stashes that you have made

提交回复
热议问题