A git subcommand to restore deleted local branch by using reflog. It can restore branches that were checked out locally in the past.
git restore-branch
The format of each line is "branch-name = commit-hash".
git restore-branch branch-name
Copy git-restore-branch somewhere in your PATH.
- Branches that have never been checked out locally cannot be restored. git-fsck or git-resurrect may help.
- It will not work properly if the previous reflog of the reflog that left the branch has been deleted.
MIT