The Swiss player, who has won the German competition five times, said that his recent French Open final defeat to Rafael Nadal had taken his toll.
“I am very disappointed as it’s one of my absolute favourite tournaments on the ATP Tour, but my body, especially my groin, really needs a rest,” he told his website.
“After talking with my team this morning, I feel that it’s way too risky to take a chance on aggravating it even more before Wimbledon.”
The 29-year-old, who has taken the Wimbledon trophy six times, has said that the grass tournament is “the huge priority right now... that’s always the number one goal in the season”.
Wimbledon gets under way on June 20.