repo如何取消本地改动(How to discard changes using repo) Android源代码中经常出现同步问题,最常见的就是本地无意修改了某些文件,那么,如何取消掉这些更改呢? 执行如下命令: Shell $repo forall -vc "git reset --hard" 1 $repo forall -vc "git reset --hard" 如果执行完成后,依旧提示某个目录有改动,则切换到有问题的目录,继续执行 Shell $git reset --hard 1 $git reset --hard 完成后,删除所有没有增加到Git中的文件即可。 参考链接: How to discard changes using repo 发布者 默默 码农 查看默默的所有文章