Search code examples
gitrestorerecover

Restore git repository/commits etc


I accidentally deleted a project with a .git/ in it. There is only this local repository.

I recovered many files using recuva and the project is restored there. But the .git-things aren't back, because I only have a single folder containing all the files: http://pastebin.com/sBiQ9fin and I don't know where to put them.

Is it possible to put those files back in a .git/ folder so that I can restore all the commits etc of the project?


Solution

  • It doesn't seem likely you'll be able to recover anything more. To avoid this happening again, I'd recommend getting a repo set up on one of the various code hosting sites (github, gitorious, repo.or.cz). They have support for private repos if you need, some free and some not.

    Also, disk backups are another method to keep the code safe.