1

I am working on git and I forgot to git fetch before pushing. What happened is all files are deleted including my local files. On the logs says they are stripped. I tried reverting but nothing happens. Can anyone help me?

Edit: BTW, our git host is bitbucket

hodl
  • 1,420
  • 12
  • 21

2 Answers2

1

If you are pushing to a git hosting site (GitHub, BitBucket), you would need to contact that site to restore those stripped commits.
As I mentioned before, reflogs aren't accessible from those upstream repositories.

See for instance "bitbucket stripped git revisions".

If you have access to the upstream repo, then reflogs can help you, as in "restoring lost commits".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I tried checking out the your references and found out we have the same problem. So, I'll have contact bitbucket. Thanks! – hodl Feb 10 '13 at 09:41
0

You could use

git reflog

to see the history of where your git branches were pointing to. If you see something that happened before you did this push, simply use

git checkout <sha1>

to checkout to the state you had before.

mvp
  • 111,019
  • 13
  • 122
  • 148