When teeing off during a game of golf, if a male fails to hit his ball past the ladies tee blocks, he must open his fly and let he penis hang out in full view for the remainder of the hole.
When you are having sex and the rhythm is just starting to get good, and the dick falls out. You have to put it in again and start the rhythm all over again.
For this reason, the term can also be used when something was great and turned shitty in a minute. Or you thought you had something and it was ripped out of your grasp at the last second!