Recover a Deleted Git Branch with Reflog

  • Author: Techiediaries Team

In this quick tip, we'll see how to recover a removed Git branch using Reflog

First, run the following command to display the SHA1 of your commits:

$ git reflog

Look for the SHA1 code of your deleted branch and then run the following command:

$ git branch <sha1>

This will recover your deleted branch.

Angular Cookbook
What's new with Angular 12
An Angular 11 Roadmap - The Past, Present, and Future of Angular
Angular 11 Developer Roadmap
Vue 3 Playground