The answer depends on your answer to several questions. So, if this is your first bankruptcy case, then when you file your case the creditor has to stop the foreclosure process. Then, if the creditor wants to still foreclose they will have to file a Motion seeking permission of the bankruptcy court judge to go forward with the foreclosure.
If this is not your first bankruptcy case, then please ask your attorney if filing will save your home. This will take a few more bits of information to answer fully and completely.
In the long run, you must pay the on-going and prepetition (before filing) arrearages, if any, to save your home. Or you may be able to obtain a loan modification, and get current with your mortgage payments.