git - How to undelete a branch on github? -


it seems delete branch on github when should not it.

what did follow:

1- add new .gitignore system

2- use

 git rm -r --cached .    git add .    git commit -m ".gitignore working"   

when did this, had 1 branch on local system server had 2 branch.

then pushed branches server , since had not second branch, second branch deleted on server.

how can bring back?

i using github remote server.

if know last commit message of deleted branch can this:

git reflog 

# search message

fd0e4da head@{14}: commit: commit message want 

# checkout revision

git checkout fd0e4da  

or

git checkout head@{14} 

# create branch

git branch my-recovered-branch 

# push branch

git push origin my-recovered-branch:my-recovered-branch 

Comments