A bankruptcy can stop a foreclosure all the way up until the foreclosure auction date. A bankruptcy can help you in 4 different ways in a foreclosure situations:

1. If you are in the process of getting a loan mod or want to try and get a loan mod, a bankruptcy can give you time to complete the loan modification process. HAMP specifically requires that lenders consider borrowers in active bankruptcy.
2. If you can afford your regular monthly mortgage payments, the bankruptcy can impose a repayment plan to cure your arrears that, if approved by the court, the lender MUST accept. Generally, you must be able to catch up on all your back mortgage payments within 5 years and maintain your regular monthly mortgage payments.
3. If you have equity in your home and want to refinance or sell your property, a bankruptcy can give you additional time to obtain refinancing or sell your home under the supervision of the bankruptcy court. Being in Chapter 13 bankruptcy will put you back in control of the marketing and sale of your home and allow you to recover some equity, unlike a foreclosure where you will typically get nothing. Homeowners over 62 may be able to use a reverse mortgage as part of their bankruptcy plan.
4. If you just can’t afford the mortgage, due to a change in income, a rise in interest rates, or other factors beyond your control, a bankruptcy can allow you to walk away from your mortgage. The bank gets your house but in exchange, your mortgage debt is discharged. If you choose this option, you will normally have 3-6 months of no mortgage payment before you need to move out (sometimes longer, depending how long it takes the mortgage company to complete its foreclosure). Think of it as free rent in exchange for all those mortgage payments you did make.