Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restore deleted git branch from Phabricator revision

I have an opened phabricator revision and I have accidentally deleted the underlying git branch. I can retrieve the diffs from the revision and re-create the branch.

But, Is there a way howto restore the deleted branch from the revision?

like image 350
Aleš Avatar asked Oct 24 '25 02:10

Aleš


2 Answers

You can use arc patch to create a branch. It will create a branch called arcpatch-D### where D### is your Diff ID. Once you have that branch, you can use git commands to create a new branch based from the head of that branch and name it however you like.

Recommended steps: 1. arc patch D### 2. git checkout -b new-branch-name

From there you can do anything else you like.

like image 182
CEPA Avatar answered Oct 25 '25 16:10

CEPA


If you have access to the underlying git repo, you can simply use git reflog: you will see the commit referenced by the deleted branch.

See for example "How do I get the deleted-branch back in git?".

like image 20
VonC Avatar answered Oct 25 '25 17:10

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!