Mid Version Control

How do you recover a deleted branch?

If you deleted a branch accidentally but haven’t run garbage collection yet, it can be

recovered using the commit log.

Steps:

Find the last commit of that branch:

git reflog

Example output:

abc1234 refs/heads/feature/login: commit: Add login validation

More from Developer Essentials

All questions for this course