Checkout another branch when there are uncommitted changes on the current branch

前端 未结 5 2061
北恋
北恋 2020-11-21 06:10

Most of the time when I try to checkout another existing branch, Git doesn\'t allow me if I have some uncommitted changes on the current branch. So I\'ll have to commit or s

5条回答
  •  野性不改
    2020-11-21 06:45

    In case you don't want this changes to be committed at all do git reset --hard.

    Next you can checkout to wanted branch, but remember that uncommitted changes will be lost.

提交回复
热议问题