Git restore

From NovaOrdis Knowledge Base
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>).