The answer is yes. Bankruptcy will get rid of the debt but will not stop your mortgage company from taking your home back via the foreclosure process.
The good news is that a bankruptcy will prevent the mortgage company from ever pursuing you for money.
There are a couple different ways that your mortgage company can take your property back from you.
Deed in lieu of foreclosure: You sign over all interest in the property to the lender. This avoids the foreclosure process and is slightly better for your credit than a foreclosure
Foreclosure: There are two common types of foreclosure in the United States – judicial and nonjudicial. Judicial foreclosure, as the word implies, requires the lender to go through the court system to take back ownership of the property. Nonjudicial foreclosure allows the lender to sell the property at a foreclosure auction, without court approval, after following a state-specific foreclosure process.
The bankruptcy filing does not provide the lender a way to recover the property. It must still proceed with one of the two above methods. In some cases, the lender will wait until your bankruptcy case is closed to start or continue the foreclosure process. In other cases, the lender will not wait that long and will file the appropriate paperwork with the bankruptcy court to allow it to take the property out of bankruptcy protection and continue with the sale
As for the lender reporting the foreclosure, unfortunately, it will be on your credit report even though the balance was discharged in bankruptcy. And while I don’t have personal experience working with people trying to buy a home after bankruptcy or foreclosure, I have been told by mortgage brokers that lending institutions will sometimes wait two to three years from the date of the bankruptcy discharge or foreclosure sale, whichever is later, before approving a home loan application.