Swapnil Srivastav
Swapnil Srivastav

Reputation: 202

Git - Recover Deleted branch from local and remote

Can I get my deleted git branch back, I deleted it from local and remote repository.

Upvotes: 4

Views: 8756

Answers (1)

YoannFleuryDev
YoannFleuryDev

Reputation: 941

Run git reflog to find the sha1 of the commit that was on the top of your deleted branch, then just run git checkout -b <branch> <sha1> and you're all set.

Upvotes: 13

Related Questions