Background: Trevor was working on a test project solely for the purpose of trying out git. This is a local one-person repository that has not been shared so Trevor did a reset hard in order to obliterate some unwanted commits:
:git reset --hard 6aa32cfecf4
HEAD is now at 6aa32cf auto commit Sun Feb 28 16:00:10 -0800 2010
As mentioned in The illustrated guide to recovering lost commits with Git, you can recover "lost" commits (as in "no longer referenced by a branch or a tag").
That is why they still show up in gitk.
For instance, a:
$ git fsck −−lost-found
would also display them.
To clean this up (assuming you having nothing to get back from any other delete operations)
$ git gc --aggressive $ git prune
See also git gc: cleaning up after yourself.
If that branch had been shared, a possible alternative would have been a
git revert in order to make a new commit cancel the n previous ones.