It's basically what Unnamed has described. The collision transfers a lot of water to Mars, which melts, and then gives it a surface ocean. Since the outer layers of a planet are stripped first, the water can be completely removed from your planet A.
I've stated this in other topics as well, but we're adjusting how the water works, so you'll not have planets be so easily covered in the future.