git restore [pathspec...]

Restore working tree files

Arguments

NameDescription
pathspec

Options

NameDescription
-s, --source <tree>Restore the working tree files with the content from the given tree
-p, --patchInteractively select hunks in the difference between the restore source and the restore location
-W, --worktreeUse the worktree as the restore location
-S, --stagedUse staging as the restore location
-q, --quietQuiet, suppress feedback messages
--progressProgress status is reported on the standard error stream by default when it is attached to a terminal
--no-progressDisable progress status reporting
-2, --oursWhen restoring paths from the index, check out stage #2 (ours) for unmerged paths
-3, --theirsWhen re out paths from the index, check out stage #3 (theirs) for unmerged paths
-m, --mergeWhen restoring files on the working tree from the index, recreate the conflicted merge in the unmerged paths
--conflict <style>The same as --merge option, but changes the way the conflicting hunks are presented
--ignore-unmergedWhen restoring files on the working tree from the index, do not abort the operation if there are unmerged entries
--ignore-skip-worktree-bitsIn sparse checkout mode, by default is to only update entries matched by <pathspec> and sparse patterns in $GIT_DIR/info/sparse-checkout
--recurse-submodulesIf <pathspec> names an active submodule and the restore location includes the working tree, the submodule will only be updated if this option is given, in which case its working tree will be restored to the commit recorded in the superproject, and any local modifications overwritten
--no-recurse-submodulesSubmodules working trees will not be updated
--overlayIn overlay mode, the command never removes files when restoring
--no-overlayIn no-overlay mode, tracked files that do not appear in the --source tree are removed, to make them match <tree> exactly
--pathspec-from-file <file>Pathspec is passed in <file> instead of commandline args. If <file> is exactly - then standard input is used
--pathspec-file-nulOnly meaningful with --pathspec-from-file. Pathspec elements are separated with NUL character and all other characters are taken literally (including newlines and quotes)
--Do not interpret any more arguments as options