What You Did Wrong
Since you missed the car, that is all that matters.
However, yes do not brake and turn. Actually, remember this rule..
When in doubt, roll the throttle - though here you may not have had the luxury.
Basically a quick swerve, right and left (assuming you have to get back to the original line).
Else brake hard to avoid straight up, called a panic stop.