CmdID

CmdID / Commands

git-checkout

Check out a branch or paths to the working tree. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Create and switch to a new branch

git checkout -b branch_nameIdentify

Create and switch to a new branch based on a specific reference (branch, remote/branch, tag are examples of valid references)

git checkout -b branch_name referenceIdentify

Switch to an existing local branch

git checkout branch_nameIdentify

Switch to the previously checked out branch

git checkout -Identify

Switch to an existing remote branch

git checkout --track remote_name/branch_nameIdentify

Discard all unstaged changes in the current directory (see git reset for more undo-like commands)

git checkout .Identify

Discard unstaged changes to a given file

git checkout path/to/fileIdentify

Replace a file in the current directory with the version of it committed in a given branch

git checkout branch_name -- path/to/fileIdentify