While you must declare all of your debts in the bankruptcy filing, you may choose to keep a car or house that you still owe money on by reaffirming the debt and continuing to make payments. You're also welcome to repay other debts, like money owed to family members or local businesses. The bankruptcy discharge only eliminates your legal obligation to pay back those debts.
If you purposely leave out a debt, asset, or a creditor, there could be severe penalties, including having your discharged debt revoked. Also, by intentionally filing inaccurate paperwork, you could be committing perjury, which is a felony.
This problem comes up sometimes, and it's completely avoidable. Just remember to give your lawyer a list of every debt you owe, including unsecured loans, credit card debts, medical bills, mortgages, and car payments, so that the attorney can prepare an accurate petition. Even if your petition has been filed with the court it can be amended, if necessary.