git restore极简使用记录
用途
撤销修改。
使用示例
工作区(
Changes) > 暂存区(Staged Chagnes) > 本地仓库 > 远程仓库
用法1
把文件从工作区Changes下丢弃。
git restore .
// or
git restore filename
执行git restore .后,Changes被清空并隐藏了。
用法2
把文件从暂存区Staged Changes下退回到Changes。
git restore --staged .
// or
git restore --staged filename
执行git restore --staged .后,原来在Staged Changes下的文件被退回到Changes下了。
注意事项
暂无。