Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Git: restore a deleted branch. (i can find a commit within that branch with `git log -p SHA`)

I deleted a branch that i want to restore.
I tried to recover it and the only thing i could find is a commit from git-log running:
git log -p 4afa3abc4218b6251dea24c910eaced6af465d11. Also – it seems that this SHA appears only on my local mac (when my colleague run this git-log command he gets an error)

I can see the changes in the output and i would like to create a brand new branch from this git log output.

How can i easily do that?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Just check out the commit and create the branch.

git checkout 4afa3abc4218b6251dea24c910eaced6af465d11
git branch yourbranch
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading