Victor
Victor

Reputation: 13368

Undo removed remote branches with git push --mirror

I accidentally ran this command: git push --mirror, and now most branches in GitHub are lost. How can I get them back? What information I need to put here?

Upvotes: 1

Views: 729

Answers (1)

VonC
VonC

Reputation: 1323313

If they are lost on the local repo (as remote tracking branches, in the "remotes" namespace), a simple git fetch should be able to get them back.

If they are lost on the server side, accessing the server and looking into the git reflog should be enough to at least see were the HEADs of the various branches were before the push.

Upvotes: 1

Related Questions