|
43 | 43 | * [Apply any stash without deleting from the stashed list](https://github.com/git-tips/tips#apply-any-stash-without-deleting-from-the-stashed-list)
|
44 | 44 | * [Apply last stashed state and delete it from stashed list](https://github.com/git-tips/tips#apply-last-stashed-state-and-delete-it-from-stashed-list)
|
45 | 45 | * [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes)
|
| 46 | +* [Grab a single file from a stash](https://github.com/git-tips/tips#grab-a-single-file-from-a-stash) |
46 | 47 | * [Show all tracked files](https://github.com/git-tips/tips#show-all-tracked-files)
|
47 | 48 | * [Show all untracked files](https://github.com/git-tips/tips#show-all-untracked-files)
|
48 | 49 | * [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files)
|
|
75 | 76 | * [Undo assume-unchanged.](https://github.com/git-tips/tips#undo-assume-unchanged)
|
76 | 77 | * [Clean the files from `.gitignore`.](https://github.com/git-tips/tips#clean-the-files-from-gitignore)
|
77 | 78 | * [Restore deleted file.](https://github.com/git-tips/tips#restore-deleted-file)
|
| 79 | +* [Restore file to a specific commit-hash](https://github.com/git-tips/tips#restore-file-to-a-specific-commit-hash) |
78 | 80 | * [Always rebase instead of merge on pull.](https://github.com/git-tips/tips#always-rebase-instead-of-merge-on-pull)
|
79 | 81 | * [List all the alias and configs.](https://github.com/git-tips/tips#list-all-the-alias-and-configs)
|
80 | 82 | * [Make git case sensitive.](https://github.com/git-tips/tips#make-git-case-sensitive)
|
@@ -331,6 +333,17 @@ __Alternatives:__
|
331 | 333 | git stash drop <stash@{n}>
|
332 | 334 | ```
|
333 | 335 |
|
| 336 | +## Grab a single file from a stash |
| 337 | +```sh |
| 338 | +git checkout <stash@{n}> -- <file_path> |
| 339 | +``` |
| 340 | + |
| 341 | + |
| 342 | +__Alternatives:__ |
| 343 | +```sh |
| 344 | +git checkout stash@{0} -- <file_path> |
| 345 | +``` |
| 346 | + |
334 | 347 | ## Show all tracked files
|
335 | 348 | ```sh
|
336 | 349 | git ls-files -t
|
@@ -527,6 +540,11 @@ git clean -X -f
|
527 | 540 | git checkout <deleting_commit>^ -- <file_path>
|
528 | 541 | ```
|
529 | 542 |
|
| 543 | +## Restore file to a specific commit-hash |
| 544 | +```sh |
| 545 | +git checkout <commit-ish> -- <file_path> |
| 546 | +``` |
| 547 | + |
530 | 548 | ## Always rebase instead of merge on pull.
|
531 | 549 | ```sh
|
532 | 550 | git config --global branch.autosetuprebase always
|
|
0 commit comments