mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-12-26 18:32:41 +03:00
20 lines
427 B
Markdown
20 lines
427 B
Markdown
# git checkout
|
|
|
|
> Checkout a branch or paths to the working tree.
|
|
|
|
- Create and switch to a new branch:
|
|
|
|
`git checkout -b {{branch_name}}`
|
|
|
|
- Switch to an existing local or remote branch:
|
|
|
|
`git checkout {{branch_name}}`
|
|
|
|
- Undo unstaged local modification:
|
|
|
|
`git checkout .`
|
|
|
|
- Replace a file in the current working directory with the version of it committed in a given branch:
|
|
|
|
`git checkout {{branch_name}} -- {{file_name}}`
|