How? Coal accounted for 33.3% of electricity production in 2022. Nuclear power accounted for 13.3% of German electricity supply in 2021.
Germany's shutdown of their nuclear generating capacity, and their dependence on Russian natural gas was a major factor in the invasion, and hence Germany's necessity to shift back to coal.
It was a stupid move, considering that Germany also pushed to classify gas power as "clean" in the EU.