A Chapter 13 bankruptcy is a debt consolidation plan designed to help you keep your home, assuming you have income to support making the payments. Filing the Chapter 13 plan will legally protect your home from foreclosure as long as the petition is filed with the court before the foreclosure sale occurs.