Below the master
is the branch and change that to correct one.
max=$(git log --oneline|wc -l); for i in $(seq $max -500 1); do echo $i; g=$(git log --reverse --oneline --skip $i -n1|perl -alne'print $F[0]'); git push origin $g:refs/heads/master; done