1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 09:08:01 +00:00

Add Grab A Single File From A Stash as a git til.

This commit is contained in:
jbranchaud
2015-09-22 22:24:39 -05:00
parent d3d2e384ba
commit e116e1bf54
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# Grab A Single File From A Stash
In git, you can reference a commit SHA or branch to checkout differing
versions of files.
```bash
$ git checkout d3d2e38 -- README.md
```
In the same way, you can snag the version of a file as it existed in a
stash. Just reference the relevant stash.
```bash
$ git checkout stash@{1} -- README.md
```
[source](http://stackoverflow.com/questions/1105253/how-would-i-extract-a-single-file-or-changes-to-a-file-from-a-git-stash)