0

I git init on an existing repository and force pushed it to master. I had an earlier version of repository with few (around 100-120) files of which I don't have a local copy ,Now the whole repository has been over written and I have only 2 new files.

I have tried cloning repository and tried getting earlier logs , but there is only one commit in entire repository log.

How can I get back the repository to normal version ?

These was code i used :

 git init
 git add .
 git commit -m "New files"
 git remote set_url origin "Link to my repository.git"
 git push origin +master

1 Answers1

0

If you've force-pushed over your old content on GitHub, you can contact GitHub Support and they can find the old version and possibly create a branch in that repository for you with the old contents that you can then fetch.

bk2204
  • 64,793
  • 6
  • 84
  • 100
  • Thanks for suggesting to contact support team, With Github support i got my commit history and from that i created a branch to restore old version – lokesh Arundathi Apr 13 '20 at 17:25