Yes.  The automatic stay in bankruptcy will temporarily stop any eviction IF the case is filed before the eviction process has terminated your rights to possession of the property.   How long the protection lasts depends on which bankruptcy chapter you file and whether you provide for catching up on the past due rent amounts.

See more information on evictions in bankruptcy.