The most brilliant programmer I know is me three years ago. I look at code I wrote and I'm literally wondering "how did I figure out how to do that -- that makes no sense, but exactly what is needed!"
Wow. Lucky you. When I come across code I wrote months ago, usually I'm like "what kind of crack was I on when I wrote this?"
How can I learn this skill? Past Me is usually just this idiot who made work for Present Me.
I had a funny example of that.
I had a question about how to do something in Django, and after googling found a good SO answer.
I read through it thinking about how much I appreciated the author's detailed explanation and answer.
When I looked at the author it was me from two years ago.