git restore --staged <file>... 命令用于将文件从暂存区(Staged Area)中移除,即撤销 git add 操作,但保留工作区(Working Directory)中的修改。 具体来说,当你在开发过程中,可能会将某些文件的修改添加到暂存区,但随后决定不将这些修改包含在当前提交中。这时,你可以使用 git restore --staged <fi...
in Public note Git unstage version control git reset filename.txt Will remove a file named filename.txt from the current index, the "about to be committed" area, without changing anything else. To undogit add .usegit reset(no dot). ...
Most untracked files will be staged and committed. Others will simply be ignored by including them in the.gitignorefile. However, some files and directories will remain untracked, and in certain instances it can be useful to delete these untracked files from your Git repo. In this article, we...