"Really sorry to announce that I will not be competing at the Olympic Games," she said on her Twitter feed. "I'm heartbroken and sad as can be but I'm just not ready yet."
Petkovic tore ankle ligaments at the Stuttgart Grand Prix in April having just returned from a stress fracture of her back.
Bosnian-born Petkovic was one of four German women to qualify for the Olympic singles, along with Angelique Kerber, Sabine Lisicki and Julia Goerges.
The International Tennis Federation said there had been no decision yet on who would replace Petkovic in the 64-strong women's singles draw.