git reset
1. git reset HEAD <file>
将 某文件 撤出暂存目录stage
mrhero@MrsHero:~/mrhero/bitbucket_pro/fun_excel$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: .gitignore
new file: new_file_test2.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
new_file_test.txt
执行后:
mrhero@MrsHero:~/mrhero/bitbucket_pro/fun_excel$ git reset HEAD .gitignore
Unstaged changes after reset:
M<span style="white-space:pre"> </span>.gitignore
mrhero@MrsHero:~/mrhero/bitbucket_pro/fun_excel$ git status
On branch master
Your branch is up-to-dat