git restore极简使用记录
文章目录
用途
撤销修改。
使用示例
前置知识
工作区(Changes) > 暂存区(Staged Chagnes)
修改文件后,文件会出现在工作区。git add .或者git add filename后,文件会出现在暂存区。
用法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下了。
注意事项
暂无。
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论