The [restore] Command
Restore working tree files
Usage
libra restore [OPTIONS] <PATHSPEC>...
Arguments
<PATHSPEC>...
- files or dir to restore
Description
Restore specified paths in the working tree with some contents from a restore source. If a path is tracked but does not exist in the restore source, it will be removed to match the source.
The command can also be used to restore the content in the index with --staged
,
or restore both the working tree and the index with --staged
--worktree
.
By default, if --staged
is given, the contents are restored from HEAD
, otherwise from the index.
Use --source
to restore from a different commit.
Options
-
-s <SOURCE>
,--source <SOURCE>
Restore the working tree files with the content from the given tree. It is common to specify the source tree by naming a commit, branch or tag associated with it.If not specified, the contents are restored from HEAD if
--staged
is given, otherwise from the index. -
-W
,--worktree
,-S
,--staged
Specify the restore location. If neither option is specified, by default the working tree is restored. Specifying--staged
will only restore the index. Specifying both restores both.