首页 > 解决方案 > 如何取消暂存所有已暂存以进行提交的文件?

问题描述

说我想取消暂存所有这些文件。是否有一个命令可以这样做?

hend0825@csel-apollo:/home/hend0825/3081_s20/repo-hend0825/project/src $ git add -A
hend0825@csel-apollo:/home/hend0825/3081_s20/repo-hend0825/project/src $ git status                                                                                                                                                          On branch pause/resume
Your branch is up to date with 'origin/pause/resume'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified:   ../../exercises/ex02_inheritance/composed.h
modified:   ../../exercises/ex02_inheritance/derived.h
new file:   ../../exercises/ex02_inheritance/inherit
new file:   ../../exercises/ex02_inheritance/inherit.h
modified:   ../../exercises/ex02_inheritance/main.cc
new file:   ../../exercises/ex02_inheritance/main.o
modified:   ../drivers/bus_driver.cc
modified:   ../drivers/route_driver.cc
new file:   #bus.cc#
modified:   bus.cc
modified:   bus.h
new file:   ../tests/.gitignore
new file:   ../tests/.route_UT.cc.swp
new file:   ../tests/bus_UT.cc~
new file:   ../tests/route_UT.cc~
modified:   ../web_code/web/main.cpp
modified:   ../web_code/web/my_web_server_command.cc
modified:   ../web_code/web/my_web_server_command.h
modified:   ../web_code/web/visualization_simulator.cc
modified:   ../web_code/web/visualization_simulator.h
modified:   ../web_graphics/sketch.js

标签: gitgithub

解决方案


<file>是可选的:

 git reset HEAD

推荐阅读