https://www.nolo.com/legal-encyclopedia/evictions-automatic-stay-bankruptcy.html
The Landlord Can Fight the Stay of Eviction
If you file a bankruptcy case before the landlord gets the judgment of possession, the automatic stay will be put in place and stop the eviction—but not necessarily for long.
The Landlord Can Ask to Proceed With the Eviction
The landlord can file a motion asking the bankruptcy court for permission to evict you. The landlord requests permission by filing a motion to lift the automatic stay. The court will typically grant the landlord’s request unless you have a good reason why the eviction shouldn’t take place.