brewly — Ch.1 · You'll see this elsewhere
Exercise 8 of 11
Before you start
Before restore existed
git restore is fairly new. Older guides and many colleagues use reset and checkout for the same two jobs. Both still work.
In git checkout -- <file>, the -- tells git that what follows is a file name, not a branch name.
- git reset HEAD <file>
- unstage, like
git restore --staged <file> - git checkout -- <file>
- discard changes, like
git restore <file> - git status
- check the result
You can reopen this any time with “Lesson”.
body {background: hotpink;font-family: system-ui, sans-serif;margin: 2rem;}
Graph
- 1354d06 Add menu pageHEAD → mainorigin/main
- 619eb3b Style the order button
- 5fc44ac Initial commit