3

I just accidently ran

git push -f --mirror

how do I undo it? My remote repository is completely gone

Vladimir
  • 2,481
  • 4
  • 31
  • 41
  • Take a look at this answer: http://stackoverflow.com/questions/1270514/undoing-a-git-push#1270608 – pierrefevrier May 19 '15 at 16:47
  • This has nothing to do with the fix. And based on what I see, there is not fix except for asking another dev who cloned the repo to re-push the branches. – Vladimir May 19 '15 at 17:29
  • your repo should contain a log/refs/heads which should contain previous commitish values the ref used. You can always manually revert your mess up via git reset --hard . Followed by another git push -f, no? – whoisj May 19 '15 at 18:32
  • No, doesn't work with my copy. When you do 'git push -f --mirror' all of the local branches that I haven't explicitly checked out disappear as well. When I did 'git branch -avvv' only the couple of branches that I worked on showed up. I had to ask someone to resubmit all of the branches. Never run this command! :) – Vladimir May 20 '15 at 01:03
  • This worked for me, if you got the latest refs somewhere: https://stackoverflow.com/a/53662585/6012789 – Sagre Dec 07 '18 at 02:59

0 Answers0