The striker, 27, had one year remaining on his deal with the Sky Blues, but has now departed and penned a two-year agreement at Priestfield.
McDonald is no stranger to the Gills having bagged 25 goals during a season-long loan spell from Norwich in 2010/11.
Gills boss Martin Allen told the club's official website: "Cody is a matchwinner, he scores goals and in his loan period, on and off-the-field, he conducts himself in the right way.
"He works hard and Mr Scally (chairman) has worked for the last couple of months to get this deal done.
"Last time here he got 26 goals in one season and this time he will be looking for 30!"
Coventry snapped up his services in the summer of 2011, but McDonald failed to establish himself at the midlands club during his two-year stay, scoring just eight times in 47 appearances.
He duly returned to the Gills on loan last season and regained his scoring touch, finding the net four times in seven outings, before being recalled by Coventry after just one month.
McDonald's return for a third spell in Kent comes just a week after former strike partner Adebayo Akinfenwa also rejoined Gillingham.
- Sports & Recreation