brewly — Ch.9 · Where did that code go?
Exercise 2 of 5
Before you start
Searching the changes themselves
git log -S <text> finds the commits where the number of times a text appears changed: where it was added, and where it was removed.
-p shows each commit’s changes under it, and --stat just the files. git show <commit> does the same for one commit.
Once you know the guilty commit, git revert undoes it.
- git log --oneline -S <text>
- commits that added or removed it
- git log -p -S <text>
- the same, with the changes
- git show <commit>
- one commit with its changes
- git revert <commit>
- undo it with a new commit
You can reopen this any time with “Lesson”.
# BrewlyOrder coffee ahead.## Team- Maya (lead)- Alex (frontend)
Graph
- 6826eae Widen the page marginHEAD → main
- 35ea4de Add opening hours
- 89d7ab0 Tidy up the cart
- 1f3c606 Reward loyal customers
- 1354d06 Add menu pageorigin/main
- 619eb3b Style the order button
- 5fc44ac Initial commit