restore
约 128 字小于 1 分钟
2025-03-13
主要作用
重置工作区
语法
git restore [<options>] [--source=<tree>] [--staged] [--worktree] [--] <pathspec>…
git restore [<options>] [--source=<tree>] [--staged] [--worktree] --pathspec-from-file=<file> [--pathspec-file-nul]
git restore (-p|--patch) [<options>] [--source=<tree>] [--staged] [--worktree] [--] [<pathspec>…]
常用的参数
参数 | 解释 |
---|---|
-S,--staged | 将暂存区的代码恢复到工作区 |
-W,--worktree | 撤销工作区文件的修改 |
常用命令举例:
撤销暂存区的修改,恢复到工作区
git restore --staged .
撤销工作区的变化
git restore --worktree .
更新日志
2025/8/24 08:17
查看所有更新日志
e7112
-1于