I often feel this way—needing a sort of "clean slate" to be productive again, after a disruption. Once I "mess up" the flow, I often feel like I've already tarnished some record, and don't feel like starting right away again.
Maybe some people can just tell themselves that a new start is a new start—that one shouldn't get so hung up about something that happened half an hour ago—but me, I'm not so good at that—for me, feelings persist, regardless my knowledge of what's (ir)rational to think.
What's worked for me is discovering physical "rituals" that make me feel "fresh" again, and reenacting these rituals each time I feel I need a new start. Some of my rituals include
- brewing a pot of my favorite coffee,
- making myself some tea (a specific tea reserved for this ritual),
- washing my hands and face,
- putting on cologne (a specific citrus-scented one, which reminds me of cleanness).
I found that physical rituals like these not only provide one-off "resets" to help me refocus, but also, with repetition, strengthen so much in association with "clearing the slate" that they even help when I'm feeling bad about non-productivity-related things.
Of course, YMMV.