I accidentally deleted my .git folder, I would like to recover the .git folder, but I permanently deleted it.
Will I lose all my project's history?
I also tryed the following solution with no success.
Notes:
- It happened when I imported the code to the Eclipse IDE.
- I made many local changes without pushing them.
- I also using GitHub as a repo.
- Using Windows 10.
CodePudding user response:
If you have pushed your changes to GitHub, then all your history is sitting in the repo on GitHub. You can clone the repo again.
If you have not pushed your changes to a remote repo, then the only place that those changes existed is in your local .git directory in your project directory, and those changes are now gone.
CodePudding user response:
I had to re-clone the repository and paste the .git folder in the recently cloned project, into the project's folder.
So I only lost the local commits.