Git restore

From NovaOrdis Knowledge Base
Revision as of 00:56, 3 December 2020 by Ovidiu (talk | contribs) (Created page with "=Internal= * git checkout =Overview= Restore working tree files: <syntaxhighlight lang='bash'> git restore -- <path-to-file> </syntaxhighlight> 'git restore' and 'gi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

Restore working tree files:

git restore -- <path-to-file>

'git restore' and 'git checkout' are equivalent, 'git restore' was introduced with the sole purpose of splitting and clarifying the behavior of 'git checkout', which can be used both to reset files to certain revisions (git checkout -- <path-to-file>) and to switch to a branch (git checkout <branch-name>).