Kent Beck calls this the "Red Test Pattern". If you do test-driven development, check in your code, write one more test that fails, and only then stop working.
I find it especially powerful at the end of a long day when you've been deep in the details. When you come in the next morning and see that red test, you "download" the context you were in much more quickly. I've also noticed that you tend to remember little details and nuances more clearly.
Works wonders for me.