If you've filed for bankruptcy, you're not alone. The American Bankruptcy Institute reported 789,222 personal bankruptcy filings in 2015. And here's the truth: Many of the people behind these bankruptcies will one day be able to qualify for a mortgage and buy a home.

Bankruptcy does devastate your credit score, usually causing it to fall by 200 or more points. And depending on the type of bankruptcy you file, this negative mark will remain on your credit report for 7-10 years. So a bankruptcy filing will make qualifying for a mortgage difficult ... at first.

But if you're patient, and you're willing to make the financial decisions that will gradually boost your credit score, you will be able to qualify for a mortgage even with a bankruptcy in your past.

"The most important steps to get your credit back on track post-bankruptcy is to establish new credit with a good payment history," said Jason Zimmer, owner of Parlay Mortgage & Property in Lockport, Illinois. "Bankruptcies will stay on your credit report for up to 10 years, but the damage they cause fades as each year passes."

Patience matters after bankruptcy

People –not businesses – tend to file for one of two types of bankruptcies: Chapter 7 and Chapter 13.

In a Chapter 7 filing, most or all of your debts will be forgiven. But you might lose key assets such as your car or home. In a Chapter 13 filing, you work with a bankruptcy judge to pay back all or a portion of your debts according to a set schedule. This should leave you with regular monthly payments that you can comfortably afford.

Each type of bankruptcy will hurt your credit score. But a Chapter 7 bankruptcy will remain on your credit report for 10 years, while a Chapter 13 filing will fall off after just seven.

You won’t be able to apply for a mortgage loan immediately after either type of bankruptcy, not that your diminished credit score would let you qualify, anyway. To apply for a conventional mortgage loan, one not insured by a government agency, you must wait at least four years after the discharge of a Chapter 7 bankruptcy. You’ll have to wait at least two years after the discharge of a Chapter 13 filing.

To apply for a loan insured by the Federal Housing Administration or U.S. Department of Veterans Affairs, you’ll have to wait two years after your Chapter 7 bankruptcy is discharged. You can apply after a Chapter 13 filing as long as you’ve made 12 months of consecutive on-time bankruptcy payments. You will need approval from the bankruptcy court, though, to apply.

After these waiting periods end and you do apply for a loan again, be prepared to pay a bit more.

"It is absolutely possible to qualify for a home loan after bankruptcy, even a conforming one," said Casey Fleming, author of The Loan Guide: How to Get the Best Possible Mortgage. "You might pay more for the loan, though, since pricing is highly sensitive to credit scores today. But you can qualify for sure."

Recovering after bankruptcy

Waiting out the one to four years needed to apply for a loan is just one step in making yourself once again an attractive borrower. Even after the bankruptcy waiting period ends, you might still struggle to qualify for a mortgage if your credit score remains low.

Your best move is to immediately begin establishing a new credit history: Pay all your bills on time every month. Don’t run up debt on your credit cards.

If you are able to do this, the negative impact of a bankruptcy filing will gradually fade and your credit score will steadily rise.

The further into your past a bankruptcy filing is, the less of a drag it will be on your credit score. A bankruptcy filing that is seven years old will have less of a negative impact on your score than will one that is only four years old.

Re-establishing credit

Establishing new credit after a bankruptcy is no easy task. Many credit-card companies will hesitate before making credit available to you. Zimmer recommends that people start by applying for a secured credit card. These cards are easier to get because their credit limits are tied to money that you deposit with the bank offering them. If you miss your payments, the bank can simply withdraw the funds from the account you’ve created.

Getting a secured credit card, charging items each month and paying off your purchases in full by every due date is one way to start rebuilding your credit score.

Just make sure to pay that credit-card bill on time each month.

“It is extremely important for that customer to continue making the payments on time,” said David Hosterman, branch manager with Castle & Cooke Mortgage in Greenwood Village, Colorado. “Having late payments on accounts after a bankruptcy can jeopardize the loan approval.”

Saving for a down payment can help

Another smart move? While you are waiting to apply for a mortgage, save up as much as you can for a down payment. If you can save up at least 20 percent of your home’s final purchase price to use for a down payment, you’ll increase the odds of qualifying for a lower interest with your mortgage. That’s because your lender will see that you’ve invested more of your own money upfront in your home purchase. That makes lenders more comfortable, especially when dealing with borrowers who have bankruptcies still on their credit reports.

Coming to lenders with a sizable down payment, little new debt and a credit score that is heading up instead of down is the best way to show mortgage professionals that the financial missteps that caused your bankruptcy are now in the past.

You might still have to shop around to find the lender willing to give you the best interest rates and fees. Fortunately, you can work with any lender licensed to do business in your state, which should give you plenty of options when you’re searching for fees and rates.

“Most lenders aren’t interested in helping someone while they’re still drowning in debt,” said Sam Wax, president of My Easy Mortgage in Tampa, Florida. “The reestablishment of credit and, specifically, revolving debt, typically helps most consumers optimize their credit scores and show the lender they have the capacity to make mortgage payments on time.”