all I did wasgit init
git add .
git --reset hard
. In this case, will your fix still bring things back from the dead?
Ah, I misunderstood. No, that did instruct git to delete
everything, without leaving any orphaned commits, so my first suggested fix won't do anything. (I assume you ran
git reset --hard, since
git --reset hard would have errored and done nothing.)
Since you staged all the files before wiping them out, it is
possible that the objects (file contents) are still hanging around in git. Try
git fsck --lost-found and see if anything gets put in
.git/lost-found (which might be a hidden folder, depending on OS). If it does, then you've got the file contents, and there
might be a way to recover the file structure (but I suspect the only copy of that was stored in the wiped-out index).
Otherwise, you should check places like wherever Lazarus saves its temporary files, but it's unlikely you'd be able to recover everything if
git fsck --lost-found doesn't work.
Git is arcane and full of footguns, so once you've got everything back to a sensible state (whether you've recovered your files or not), I'd recommend only using
Git GUI, at least until you know your way around Git.
Other GUI clients are available, but I can't vouch for them.