commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcelo Vanzin <van...@cloudera.com.INVALID>
Subject Re: [OT][GIT help] How to restore a branch in a github fork
Date Tue, 12 Feb 2019 22:34:12 GMT
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 <sebbaz@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-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>


-- 
Marcelo

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


Mime
View raw message