Saber2pr's Blog

Checkout

Checkout is one of the most important commands git uses.

switch branches

git checkout <branch-name>

Switch to a new branch

git checkout -b <branch-name>

Create a new branch from the specified commit

git checkout -b <branch-name> <commit-id>

File fallback

git log gets hash submission history

git checkout <hash> <file>

scard all uncommitted changes git checkout.