TL;DR: I deleted the .git directory, recreated it with git init, then did a git commit, then did a git push using --force option and overwritten the remote repository with an empty one.
So as a total newbie I was trying to use rclone to backup my stuff to gdrive but it messed up my work projects .git folder for some reason (probably my fault.
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
I tried but couldn't fix that. so instead as an idiot I though I would delete .git folder and pull it again from repo.
When I re cloned repo (all data was safe) I got .git folder and everything was working until I pushed new commit and when I checked on git-hub I couldn't see any previous ones. that last commit lost all of my previous commits, and branches.
All my code is safe but I lost previous commits, is there a way to get those back?
Those are very important as I'm working for a company and not on personal project.
git version 2.35.1
I deleted the .git folder using
rm -rf .git
also I have files saved both local and on git-hub repository. I want the .git folder restored.
did I screw up at a point where nothing can be done ? is there a way to get all my previous commits info and if so how can that be done ?
Thanks in advance for any useful answers