brewly — Ch.4 · Bring back a deleted branch
Exercise 7 of 9
Before you start
Deleting a branch deletes a name
The commits stay in the repository. Find the last one in the reflog, then give it a name again.
git branch <name> <commit> creates a branch at any commit. Use the short id from the reflog, or a name such as HEAD@{1}.
There is no Undo button in this exercise.
- git reflog
- find the last commit you made on the branch
- git branch <name> <commit>
- create a branch at that commit
- git log --oneline <name>
- check what it contains
You can reopen this any time with “Lesson”.
# BrewlyOrder coffee ahead.## Team- Maya (lead)- Alex (frontend)
Graph
- 1354d06 Add menu pageHEAD → mainorigin/main
- 619eb3b Style the order button
- 5fc44ac Initial commit