I tend to design stuff on paper with logical boxes and arrows, then add that as a large comment at the beginning of a complex section, then implement it without any comments in the code. That way, the code is still readable but there is a reference above it. Just like you have in books on programming languages.
The nice thing about this is, some of those survive revisions and can then be line comments which explain the next few lines of code:
Similarly, I have grown to use commit messages longer than one line, even if I expect to later rebase it together with something else.