It should come as no surprise that more consumers filed for bankruptcy or lost their homes in the last three years. Many are in line for a similar fate as the economy flirts with a double dip. At the end of it all, consumers are left staring at what remains of their once-great credit scores and wonder when they can get credit again.

The good news is a badly battered credit score isn't a life sentence.

"If you do nothing at all, except nothing bad, it will take seven to 10 years before your credit is better," says John Ulzheimer, president of consumer education at SmartCredit.com. Becoming delinquent again could set you back.

But why sit around for a decade? Bankrate outlines how to fix your credit, starting with steps to take before your credit crisis.

Anticipate Your Credit Catastrophe

If default looks imminent, cushion the blow to your credit score by defaulting on just one account. "There is a component in the FICO score called prevalence," says Ulzheimer. "That means having five collections is worse than having one."

Let the account with the highest monthly payment fall behind, he says, to free up more money every month to pay your other debt obligations.

If you have to choose between debts to pay, skip the credit card bill because it's unsecured and a creditor can't repossess anything. Luckily, credit card delinquencies hurt credit scores less than bigger debts such as home or auto loans, says Sarah Davies, senior vice president of analytics, product management and research for VantageScore Solutions.

Wait For the Flames to Burn Out

If you can't mitigate your credit crash, don't despair. Take a breather after the event, says Rod Griffin, director of public education at Experian, before mapping out your re-emergence into the world of credit.

If you have other outstanding delinquencies, catch up on those payments. If you still face looming debt out there, work on reducing it. The key, Griffin says, is time.

"You won't be able to qualify for credit for a while," he says. "Wait weeks or months so you have time to stabilize, to regain control of your current finances."

After the Dust Settles, Restart Your Credit

It's also important to know how to fix your credit using new credit accounts. A secured credit card is typically the first and only type of credit available to someone with a badly blemished credit history. These cards require a security deposit, usually a minimum of $500, to activate it. The deposit is placed in a savings account, money market account or certificate of deposit.

If you consistently make on-time payments, your bank might convert the card into an unsecured card after a year, says Barry Paperno, consumer affairs manager at myFICO.com.

The card is not treated differently than a regular credit card by the FICO score, Paperno says. Just make sure the issuer reports to the credit bureaus. Otherwise, your efforts will be for naught.

Another way to build up your credit is to piggyback on someone else's credit card account. Ask a family member or your spouse to consider adding you as an authorized user on their credit card. An authorized user is not responsible for the balance, but benefits from the cardholder's payment history on that account. So, make sure you choose a financially sound credit ride. A side note: Experian only includes authorized user accounts if the payment history is good, says Griffin.

Ulzheimer also suggests checking with your bank or credit union to see if overdraft protection on your checking account is reported to the credit bureaus. Sometimes, it is considered an unused installment loan on your credit report.

"It's not a bad way to get a good thing on your credit report," says Ulzheimer, "as long as you don't have to use it."

Lenders love to see recent good payment behavior, so pay your bills on time and keep balances low. Aim to pay off credit card balances every month to keep debt from snowballing out of control.

Check your credit report to see which items are weighing on your score, says Trey Loughran, president of personal information solutions at Equifax. For specific clues on how to fix your credit, order your credit score with your report -- it will tell you key reasons your score isn't higher.

If you're a carrot-and-stick person, consider a credit monitoring service to keep you motivated, says Griffin.

"It's important to check your credit score periodically, especially when you're in the recovery phase," Paperno says. "And it might be better than you think."

How long will it Take to Recover?

Unfortunately, knowing how to fix your credit is only half the battle. The time it takes to rebuild your credit depends on the catastrophic event and where you started. Generally, borrowers with lower credit scores experience a smaller drop in their score after a huge credit event compared with those with great credit, according to studies by VantageScore and the Federal Reserve.

If you get a mortgage modification after being delinquent on your home loan, it could take as little as nine months to lift a credit score of 625 to above 700 if all debts are brought current, VantageScore found.

The effects of foreclosures linger longer. Your credit score will start to rebound in as little as two years if you keep all other accounts in good standing, according to myFICO.com. Yet, the Fed study found that a third of prime borrowers never saw their credit scores return to pre-delinquency levels, even after 10 years following the foreclosure.

The road back from bankruptcy is longest. The VantageScore study shows that raising your credit score is difficult until the public record comes off your credit report, either seven years for a Chapter 13 bankruptcy or 10 years for a Chapter 7 bankruptcy.

That doesn't sound good, but all is not lost.

"The severe impact from a bankruptcy occurs in the first two years and will roll off from there," Davies says. "If you consistently pay on time, in two to three years, you will get into a reasonable score range."