It sounds like you’re trying to use a workflow that doesn’t quite match the way git works.
First of all, a “detached head” in git isn’t the same as Mercurial’s concept of a “head”. Git has exactly one HEAD, which is just the currently checked-out commit. “Detached” just means that you don’t currently have a branch checked out. So when you create a commit, it won’t be associated with a branch, and it’ll be lost when you checkout a different commit.
In Git, every commit that you care about should be reachable from some branch. There’s no such thing as an “anonymous branch”, which is why git warns you when committing on a detached head. Committing on a detached head is like allocating an object and then throwing away the pointer; it’s possible, but almost never what you want to do. Remember, branches in git are lightweight and can be ephemeral. Just create a branch before committing so that you can find your commits again.
All that being said, if you really want to see the structure of your repository, including commits that are only referenced from reflogs, you can use:
git log --graph --decorate $(git rev-list -g --all)