To add or substitute new parts or components to some device, structure etc., that were not previously available; to modernize
To fix an older version (or older versions) as part of the same process of fixing the newest version; to backport
The bug was so bad that we had to retrofit our patch to the last three releases, as well as the newest release.
The process by which something is retrofitted.