关于git:git-restore极简使用记录

6次阅读

共计 284 个字符,预计需要花费 1 分钟才能阅读完成。

用处

撤销批改。

应用示例

工作区(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 下了。

注意事项

暂无。

正文完
 0