What you're referring to was the Meiji Restoration, which comprised of many events that restored Japan's imperial rule. This rule led to widespread changes in Japan's social and economic structure, and was responsible for Japan emerging into the 20th century as a modernized country--a country that would eventually join Hitler in the fight against the Allies.