1、git checkout -- fileName 丢地本地工作区内容
例子: 第一次git pull 时,error: Your local changes to the following files would be overwritten by merge: consultitem-core/src/main/java/com/pajk/consultitem/core/service/http/ArchiveManagerHttpServiceImpl.java Please commit your changes or stash them before you merge. Aborting Updating 201bd6f..c2ddc83
此时,使用git checkout -- consultitem-core/src/main/java/com/pajk/consultitem/core/service/http/ArchiveManagerHttpServiceImpl.java后,可以pull成功
2、git checkout branchName 切换分支