If:

- you deleted the branch from the remote

Just push your local branch to the remote.

- you deleted the branch from the local repo only

Just checkout the remote branch again. If you had local changes that
are not in the remote, continue below.

- you deleted the branch from local and it did not exist in the
remote, or you also deleted from the remote

Check "git reflog" and see if the commits to the deleted branch still
exist. If they do you can just "checkout" them again.

- if none of the above applies, well, I think you just lost the code.

On Tue, Feb 12, 2019 at 2:29 PM sebb <seb...@gmail.com> wrote:
>
> I have a github fork of a 3rd party repo.
>
> Unfortunately I deleted a branch for which I wish to provide patches.
>
> Anyone know how to restore/recreate an upstream branch in a Github fork?
>
> I cannot destroy and recreate the fork as it has some outstanding PRs.
>
> I suppose I could create a second fork, but that seems a bit
> unnecessary - if only I could recover the missing branch.
>
> Any Git gurus here?
>
> S.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>


-- 
Marcelo

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to