Sweden came from behind to beat Germany for the first time in 24 years and make the semi-finals.