Git: Grab A Single File From A Stash

less than 1 minute read

In git, you can reference a commit SHA or branch to checkout differing versions of files.

git checkout d3d2e38 --

In the same way, you can snag the version of a file as it existed in a stash. Just reference the relevant stash.

git checkout stash@{1} --

Via jbranchaud/til.

Tags: ,