- In that way you do not need complexed
git reflog
git rebase
or other ways. - This is bad methods but maybe useful untill you get used to git.
Just copy your local git directory.
In that way you can recover git repository to backup anytime even if you deleted git directory.
Copy backup nameed directory to original named directory.
$ cp -r /path/to/repository /path/to/backup-repository
Create temporary branch and push it.
$ git branch some_branch_backup
$ git checkout some_branch_backup
$ git push origin some_branch_backup
Example
$ git branch some_branch_backup
git branch
command creates "like" a copy of current branch.
$ git checkout some_branch_backup