git - GitHub commits got deleted -



working on local copy of github project. after changing few files, tried commit , got message this not github repository, did git init, git add . , committed (after adding remote origin), , did git push origin master -f.
commits gone except one. there anyway restore these commits important? tried git reset 890dbfa4a5479cf849f2e2b525b9609a26e19573, message could not parse object '890dbfa4a5479cf849f2e2b525b9609a26e19573'.

you did force push overwrite whole commit history in branch.

you have made 2 mistakes:

  1. it looks did not clone respository copied , called git init.
  2. you can make separate branch , merge master, did not.

you can try following:

  1. try clone repository github , see if contains these objects trying reset. if yes, okay.
  2. else, contact github support full recovery of folder. if unused objects not cleaned, might you. original folder might have previous objects.

you can refer following link further help:

  1. undoing 'git push'
  2. how recover git push -force?

Comments