I had a git repo called chess_assess.
- I downgraded my local project's Vue from v3.x to v2.x by creating a new local project called chess_assess2and copying almost all content fromchess_assessinto it.
- I then deleted chess_assessand renamedchess_assess2tochess_assess.
- Finally, I reset the remote using
- git remote add origin <path_to_chess_assess.git>
- git add . && git commit -m ""
- git push -u origin main
 
This produced the error
! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/hexaquarks/chess_assess.git'
So I did:
git push -u origin main --force
which worked, but now my GitHub repo commits history is completely gone.
Is there a way to reobtain the commit history of my project while simultaneously connecting this new project to GitHub?
 
     
    