The 45-year-old man was using a nail gun while working for Acheson Construction at the glove factory site off Old Station Way.
An ambulance was called to the site last week and paramedics asked the fire service to bring the casualty to safety.
Firefighters used a hydraulic platform to bring the injured man down before he was taken to Yeovil District Hospital.
He was kept in hospital overnight for an operation to remove the nail, which missed the bones in his leg, Colin Johnson, construction director of Dorchester building firm Acheson Construction, told ThisisSomerset.
The company is carrying out the building work on behalf of developers ZeroC.
The man, who has not been named, was fit enough to return to work just days later and was feeling rather embarrassed about the incident, Johnson said.
The site, which is owned by South Somerset District Council, is being redeveloped into an eco-friendly complex of homes and commercial units.