Trailing the Italian 4-1 in the first set, 25-year-old opted to withdraw from the match in an attempt to give himself as much recovery time ahead of the June 29 grand slam event.
"I felt it yesterday during the quarterfinal (against Jerzy Janowicz) and I fought through it. But there was a little pain this morning and I tried in the match, but couldn’t really move," said Nishikori.
"I don’t want to take a big risk for Wimbledon, so I just retired from the match."
Nishikori reached the Round of 16 at the All England Club last year and hoped to improve on that performance this year.
"I cannot say much because I have to see how it will be the next couple of days. But I'm sure it's going to be okay. It's no big deal," he added.