1.丢弃刚才的编辑新建增加等等(未add 也未commit)
git restore 文件名字 #进行清除工作区的改变
或
git chechout 文件名字 #和restore的作用是一样的;
与git add .的作用相反
1实例:带$的行为关键命令
... MINGW64 /f/Test/vue/front (master)
$ 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 restore <file>..." to discard changes in working directory)
modified: src/router/modules/content.js
no changes added to commit (use "git add" and/or "git commit -a")
... MINGW64 /f/Test/vue/front (master)
$ git checkout src/router/modules/content.js
Updated 1 path from the index
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean