git-checkout: mention reset, add single-file ex.

coverage
Waldir Pimenta 2017-05-15 17:52:38 +01:00 committed by Starbeamrainbowlabs
parent 88eea86117
commit 6f9dbe9fce
1 changed files with 6 additions and 2 deletions

View File

@ -14,10 +14,14 @@
`git checkout --track {{remote_name}}/{{branch_name}}` `git checkout --track {{remote_name}}/{{branch_name}}`
- Undo unstaged local modification: - Discard all unstaged modifications in the current folder (see `git reset` for more undo-like commands):
`git checkout .` `git checkout .`
- Replace a file in the current working directory with the version of it committed in a given branch: - Discard unstaged modifications to a given file:
`git checkout {{file_name}}`
- Replace a file in the current folder with the version of it committed in a given branch:
`git checkout {{branch_name}} -- {{file_name}}` `git checkout {{branch_name}} -- {{file_name}}`