非常简单,只需要一个命令(*号代表所有更改的文件):
git checkout -- *
例如:
D:giteexxl-api>git status On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: xxl-api-admin/src/main/java/com/xxl/api/admin/controller/XxlApiBizController.java modified: xxl-api-admin/src/main/java/com/xxl/api/admin/core/model/XxlApiBiz.java modified: xxl-api-admin/src/main/java/com/xxl/api/admin/core/util/ThrowableUtil.java modified: xxl-api-admin/src/main/resources/application.properties no changes added to commit (use "git add" and/or "git commit -a") D:giteexxl-api>git checkout -- * D:giteexxl-api>git status On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean