Posts Restore a removed git branch
Post
Cancel

Restore a removed git branch

While doing some branch cleaning I accidentally deleted a branch I shouldn’t have deleted and apperently there is a way to restore it afterwards (phew!).

Get git history:

1
$ git reflog

Find row where the branch was deleted, in my case:

1
ea11348b521c HEAD@{3}: delete_branch: feature/WEB-669-add-preamble [445a97cc9223b38f1732aff35de5df87124f63105]

Restore it then with:

1
$ git checkout -b <branch> <sha>

So in my case running this to restore it:

1
$ git checkout -b feature/WEB-669-add-preamble 445a97cc9223b38f1732aff35de5df87124f63105
This post is licensed under CC BY 4.0 by the author.

Use js reduce to group array of objects by key

Remove whitespace from an svg

Comments powered by Disqus.