Git operations are not atomic, though. This is a huge implementation flaw, if not design flaw.
I had it several times that my laptop (or a VM) crashed during or short after a git commit, before it was fully written from cache to disk. The reasons vary, sometimes the VM disk was full, or some tests ran parallel to the commit that consumed too much RAM.
This doesn't happen often, but every few months. Meanwhile I "solved" this issue by making sure that the system is never in any form "stressed" while I work with Git.
Whatever the reason: The result is a broken Git repository that is so non-trivial to fix, that it was easier to clone it fresh from server and apply the missing changes again from the left-over local file of the broken repo.