If you file for bankruptcy before the bank files for foreclosure or before the foreclosure proceedings conclude, the bankruptcy automatic stay can prevent the bank from initiating or continuing collection activities such as foreclosure. However, the bank can file for relief from the bankruptcy stay, which if granted will allow the bank to continue with foreclosure. Although bankruptcy can discharge your personal liability for a mortgage, the bank still has the right to foreclose on your property if you aren’t making mortgage payments.