FahamLah

Commands

git checkout

git checkout <commit>

Risk: Careful

What it does

The older way to switch branches or visit commits.

When to use it

You will see it in old guides. Prefer switch and restore.

Example

$ git checkout a1b2c3d

Visit commit a1b2c3d (detached HEAD).