I have a web project which I have been working on for some time. I use GIT with SourceTree to keep track of changes but foolishly had no proper backups in place.
I had about 50 commits and wanted to wipe the slate clean and start with a new initial state so I deleted the .git folder, however I messed things up in SourceTree which ended up deleting all the project files (although the folders remain for some reason).
I still have the .git folder which I deleted. My question is, can I recover the last known project state from this folder, and how would I go about doing this?
If you really have the folder containing
.git
, then as far as I know all you have to do is restore this folder and Git should recognize it as a repository. If you also messed things up in SourceTree, then you delete the affected branches, or even create a new repo, and use your.git
as the source for information.