git restore --staged
时间: 2023-09-18 22:08:28 浏览: 116
git学习资料,常用命令
git restore --staged指令用于将暂存区的文件恢复到上一次提交的状态,即取消对文件的暂存。这个指令可以用来撤销已经添加到暂存区但还未提交的修改。通过运行"git restore --staged [file]"命令,可以将[file从暂存区中移除,并将其恢复到上一次提交的状态。这个指令与"git reset HEAD [file]"的效果是相同的。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [GIT中reset, restore and revert指令的区别](https://blog.csdn.net/m0_51971452/article/details/113871247)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [git:代码回退restore 、reset、revert](https://blog.csdn.net/weixin_46471601/article/details/124996185)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文