I can't answer with 100% certainty as to whether git might stow a backup copy of the work tree; but I can say that I haven't observed it to do so, I find no documentation that says it will do so, and I'd be a little surprised if it went to the cost of doing so. Hopefully someone with code-level knowledge might come up with something more definitive, but as things stand I would say your effort might unfortunately be better directed at confirming whether data was lost from the working file copies and, if so, reproducing the changes from the last committed state.
Not to be a Monday-morning quarterback, but...
I consider any checkout while there are uncommitted changes to be potentially risky; checkout --merge
more so because you're explicitly telling git you want it to bypass its normal cautions and merge changes into uncommitted working files. And a crash is a worst-case scenario; an operation that we reason about as though it were atomic may have been interrupted.
Certainly a crash at that particular moment is a fluke, and checkout --merge
might save a little time/effort on many, many instances before causing a data loss of this sort.
Still, personally what I like about git is the fact that it gives pretty strong assurances against data loss once something is committed; and commits and branches are "light weight" enough that it's fine to throw around temporary ones. So when I see the few commands that offer me a little savings in exchange for a tiny chance that I might lose data, I choose to avoid it. Doesn't mean that's the only right choice, but if you take a risk then you take a risk.