Git Tips Slides
PageUp x2: previous · PageDown x2: next · Home: index

Restore a single file

Imagine you are working on a feature branch. But you want to restore one file to the original version of the main branch.

git restore -s main path/to/file

s like "source branch"

(avoid git checkout)