git切换分支报错error: Your local changes to the following files would be overwritten by checkout:

git切换分支报错,dev表示那个分支

$ git checkout dev

error: Your local changes to the following files would be overwritten by checkout:

dev是我们项目的分支,报错了。

我是因为修改了文件,所以没有提交然后必须切出来,进错了,但是这个切出来后之前修改就没了,

慎重考虑备份,提交,再切出。

那么我们先git  checkout 出来

$ git checkout .

然后再单独

$ git checkout develop
原文地址:https://www.cnblogs.com/yangqiangche/p/12731261.html