BM: Baca dalam Bahasa Melayu
World 11: Rescue Center
I deleted a branch
You will learn: how to bring back a branch you deleted by mistake.
The problem
You cleaned up branches with -D. Then you remember: about was never merged! Is your work gone? Breathe. This happens to everyone.
Try it
Deleting a branch only peels off its label. The commits stay for a while. The reflog: Git's diary of everywhere HEAD has been. remembers them.
Tap the line with your about page commit.
0 of 1 found
Try it
Stick a new about label on that commit.
Hint
Typegit branch about HEAD@{1}, then press Enter.Predict
What does git branch -D really delete?
Pick one answer.
Check
Prevent it next time. Sort each fact.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now bring back a branch you deleted by mistake.
Go deeper (optional)
Look back at the hook. Git printed the old hash after the word was. git branch about plus that hash works too. Deleted the branch on GitHub as well? Its pull request page can often restore it.
Bahasa Melayu
Anda kemas branch (cabang) dengan -D. Kemudian anda teringat: about belum pernah di-merge (dicantum)! Kerja anda hilang? Tarik nafas. Ini berlaku pada semua orang.
Padam branch cuma tanggalkan labelnya. Commit (titik simpan) kekal untuk sementara. Reflog ingat semuanya.
Lekatkan label about baru pada commit itu.
git branch about HEAD@{1}, kemudian tekan Enter.Apa yang git branch -D betul-betul padam?
Elakkan lain kali. Susun setiap fakta.
Kini anda boleh bawa balik branch yang terpadam.
You finished this before. Practice is always welcome!
Official docs: git branch · git reflog
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?