Learn from other's mistakes...?
Russia's Maxim Devyatovsky gets suspended by Russia for his bad attitude, "finished an honorable 24th place, and now it is a shameful 24th place." for not finishing his p-bars routine after a fall; he wasn't injured, but he skips the 6th event too: "Devyatovsky, however, having lost all chance of a medal, shrugged off the last event, saying, "I don't have any interest in finishing outside of the top three. There's no difference to me between seventh place or 24th."
The coaches always teach you to finish your routine after a fall, just to get back up and do the rest of your routine, and not think about your fall, just stay focused on what you are doing, and relax. Most of the competitiors say they wanted to finish their competition clean after a fall, even if they didn't think they could medal, to show what they can do. Plus, you never know, maybe you can still medal - like Paul Hamm at the 2004 Olympics.
...So how do forget about your fall and go on with your routine and the rest of your competition - you just not think about it, and focus on the next coming up skills, breathe in and out and relax. If you are relaxed mentally it is so much better. Tense is bad. The mindset is really that you're doing the gymnastics competition for fun, for the love of it, wanting to do your best, don't think directly on the medals.