Developing on OS X? Using Xcode? You're likely to be in luck!
As described in a comment by qungu, OS X maintains an autosaved version history of files, even if you're not using time machine.
So, if you've blown away your unstaged local changes with a careless
git checkout ., here's how you can probably recover all your work.
If somebody finds this thread having destroyed some work in XCode, there is a way to get the AutoSave history. XCode itself does not have a menu entry to see the AutoSave history, but it does store it. If you open the files in question in TextEdit, you can revert and look through the AutoSave history under File > Revert.
Which is awesome, and recovered about a day of work for me, yesterday.
You might ask, "Why doesn't the git command-line UI, the premier VCS used for software engineering in 2016, at least back up files before just blowing them away? Like, you know, well written software tools for about the last three decades."
Or perhaps you ask, "Why is this insanely awesome file history feature accessible in TextEdit but not Xcode where I actually need it?"
… and both of those, I think, will tell you quite a lot about our industry. Or maybe you'll go and fix those tools. Which would be awesome.