I find that for me, socializing helps. So for example, after like 6 hrs straight of coding or doing some other logical thinking... Forgetting all about it and meeting friends, or even chatting with a stranger for an hour or two will "reset" my logical brain so that I can put more hours in later in the day.