Reputation: 953
I was working on my local copy of a GitHub project. After changing a few files, I tried to commit and I got the message This is not a github repository
, so I did git init
, git add .
and committed (After adding the remote origin), and did git push origin master -f
.
Now all the commits are gone except my one.
Is there anyway to restore these commits as they are really important? I tried git reset 890dbfa4a5479cf849f2e2b525b9609a26e19573
, but I get the message Could not parse object '890dbfa4a5479cf849f2e2b525b9609a26e19573'
.
Upvotes: 0
Views: 103
Reputation: 9405
You did force push which will overwrite whole commit history in the branch.
You have made two mistakes:
You can try the following:
You can refer the following link for further help:
Upvotes: 2