I accidentally pushed the wrong commit, which was the first commit, to the main branch of the forked repository.
Since that forked repository has a lot of directories, I always downloaded only directories that I would work on at the time on my local machine. Then, I created or modified files.
Before I pushed the first commit(the wrong one), I always had uploaded those new files or modified files on the GitHub repository using the GitHub web UI. I'd never committed to Git at that moment.
Once I uploaded those files, I deleted them from my local machine.
Then, I committed a file to Git and pushed it to GitHub(used the following command git push -f
)...now there is only one file in the repository.
I wanted to undo this and get back the forked repository with all files I uploaded.
(I did undo the commit with git update-ref -d HEAD
command, but there's no change on GitHub of course.)
I hope this explains my situation well enough, and please help me out.
(I thought I needed to ask the GitHub Support team and did, but still can't solve it yet...)