Is there any way to recover uncommitted changes to the working directory from a git reset --hard HEAD
?
(answer suitable for a subset of users)
If you're on (any recent) macOS, and even if you're away from your Time Machine disk, the OS will have saved hourly backups, called local snapshots.
Enter Time Machine and navigate to the file you lost. The OS will then ask you:
The location to which you're restoring "file.ext" already contains an
item with the same name. Do you want to replace it with the one you're
restoring?
You should be able to recover the file(s) you lost.