The discharge may have only reached your obligations for any shortage, after foreclosure. It did not discharge the lien on the real property. The lender retained the right to foreclose if you don't pay. The lender just takes the risk that the property won't fetch enough to pay the account.
Credit reporting is a proprietary process, and trying to figure out what will happen is like trying to replicate the Colonel's secret recipe.
Most foreclosure cases will show up on your credit report because it is a public record. In some areas of the US, the foreclosure may not show up if the bankruptcy court holds that reporting it would be a violation of the bankruptcy discharge.
So you roll the dice & take your chances. If you crap out, there is plenty of information available on ways to rebuild your credit.
BTW, the mortgage company only has the right to foreclose when you breach your contract with them by stopping paying. It is never convenient for them to do this, but when you don't pay, you have to expect the consequences.
Hope this perspective helps!
If you did not reaffirm the bank cannot report the foreclosure because you are not liable for the Note.
Disclaimer: This answer does not constitute legal advice. I am admitted in the States of New York, New Jersey and Massachusetts only and make no attempt to opine on matters of law that are not relevant to those three States. This advice is based on general principles of law that may or may not relate to your specific situation. Facts and laws change and these possible changes will affect the advice provided here. Consult an attorney in your locale before you act on any of this advice. You should not rely on this advice alone and nothing in these communications creates an attorney client relationship.