Many people file for bankruptcy to prevent their homes from being taken in foreclosure. The automatic stay will temporarily prevent a foreclosure no matter which type of bankruptcy you file. In a Chapter 7 bankruptcy the creditor may be able to have the stay lifted and proceed with the foreclosure. In a Chapter 13 bankruptcy, the foreclosure may be permanently stopped. The automatic stay remains in effect until the court confirms the Chapter 13 plan or the case is dismissed.