Microsoft didn't rewrite Minecraft in C++. It was rewritten in C++ by 4J Studios that were contracted to do so by Mojang in order to bring Minecraft to the consoles. Microsoft did create the Windows 10 edition and likely reused a lot of the code developed by 4J Studios.