It's a story that's played out way too often. Stocks plunge. Panic-stricken investors dump everything rather than losing all their money in the inevitable crash. But the inevitable crash doesn't happen, and the market regains all of its losses. It's no wonder so many people think the markets are rigged.

If you panic-sold last week, you're not alone. But succeeding at investing comes down to breaking the cycle of self-destructive emotional responses to bad markets. If you want to stop seeing episodes like this happen again and again throughout your investing career, you need to clamp down on what may seem at the time like a perfectly rational response to crisis situations.

Losing the battle to win the war
Financial TV channels make you feel like an idiot when you lose money in the market. Watching them, you'd think that if you were only sophisticated and nimble enough, you could always avoid losses just by making the right moves fast enough.

But in reality, even the best market mavens make dumb moves. The key, though, is that they don't let those mistakes define them. Rather, they learn from them -- and move on to bigger and better things. So if you're finding yourself on the sidelines now, here are some tips on what to do next.

1. Don't just buy everything back.
Like kids with their hands in a cookie jar who hear their parents come home, your first impulse when you make a mistake with your investing is to put everything back where it was. That would mean buying back everything you sold last week.

But realize that whatever you had in your old portfolio made you scared enough to panic, and so restoring everything to the way it was leaves you vulnerable to future panic attacks as well. Instead, take this as an opportunity to rearrange your investments in a way that you'll feel more comfortable about and will make you less likely to freak out the next time stocks dive.

2. Judge what to do based on how particular stocks and sectors have done.
Sure, the overall market may be back where it was before last week's roller-coaster ride. But that doesn't mean that every stock is back to normal.

For instance, financial stocks are still reeling from the implications of the European debt crisis. Not only is Wall Street megabank Citigroup (NYSE: C) down from its levels a week ago, but regional players BB&T (NYSE: BBT), Zions Bancorp (Nasdaq: ZION), and KeyCorp (NYSE: KEY) are also off sharply as they try to balance the Fed's long-term commitment to low rates against a slowing recovery. Similarly, cyclical stocks like consumer-goods packaging maker Owens-Illinois (NYSE: OI) and homebuilder Pulte Group (NYSE: PHM) still find themselves way below their levels from before last week. If the economy slips into a double dip, then those stocks could get cheaper still -- and staying on the sidelines may be the best place to be for now.

Conversely, you've missed the boat on some other sectors. Tech stocks Cisco (Nasdaq: CSCO) and Yahoo! have moved up sharply on positive news, so trying to replace them now would cost you a lot. You'll likely be better off finding alternatives that still have room to appreciate.

3. Give yourself some time.
The biggest fear people have after a panic is that they'll miss a huge run upward. That happened last year after a bad August.

But in the long run, it's much more important for you to get a handle on big-picture items. First, how much risk can you take in your portfolio without panicking at the first sign of a downturn? Second, what's the best way to align your portfolio to reflect that risk tolerance while still letting you meet your goals? In most cases, you'll find that adding some new investments to replace other higher-risk ones will get the job done easily and efficiently.

4. Leave yourself a time capsule.
The next time panic strikes, you won't remember how you felt after the last one -- you'll only remember that panicked feeling. So write yourself a note expressing your emotions both during and after this latest panic. Hopefully, that will help you calm down during the next crisis so that you can take better-considered action.

It's not too late
Just because you made a mistake and panicked last week doesn't mean that you're doomed to failure. All you have to do is learn from that mistake, and you'll end up being a better investor than you were.

If you need new stocks for your portfolio, we've got some ideas for you. This Motley Fool free special report talks about five stocks we've put our hard-earned money on, and we think you should too. Click on the link to see more.