Many consumers are surprised to find that they may have better credit after filing bankruptcy than they had before. When most people file bankruptcy they have lots of accounts that are not in good standing or have been charged off. Each one of these tradelines counts against the credit score. Think of bankruptcy like a penalty box for all your negative credit to go into. Instead of each negative item being counted against you, you take one hit for the bankruptcy. Usually the hit you take for the bankruptcy is lower than all the negative items combined.
It is not unusual for a client with with a long credit history but recent blemishes to be discharged from bankruptcy with high credit scores.