gitpractice.dev

brewly — Ch.2 · You'll see this elsewhere: checkout

Exercise 3 of 7

Before you start

Before switch existed

git checkout used to do both jobs: switching branches and restoring files. switch and restore split them up, but most older guides still say checkout.

git checkout <name>
switch branches, like git switch <name>
git checkout -b <name>
create and switch, like git switch -c <name>
You can reopen this any time with “Lesson”.

Continue on a desktop

Typing git on a small screen is no fun. Open this page on a laptop or desktop to practise.

Back to the path