As reported in the Evening Times, pupils at St Paul's Primary in Whiteinch were in tears when their 20ft flagpole and their eco flag were stolen.
But since then they been helped by a series of Good Samaritans and had it returned, along with even more replacement flags.
Head teacher Martin Hardie said: "On the morning of November 5, just before Bonfire Night, a former pupil came in and reported that they had seen it.
"It was lying on the cycle path adjacent to the school and buried under a pile of pallets and bits of wood that was going to be burnt that night.
"The green eco-flag was still attached to it, but it was a bit tatty, but we now have a replacement for that."
The eco flag means the school has achieved Green Flag status, for reducing, reusing and recycling items.
The St Paul's pupils earned their flag by taking part in activities such as tidying up the school grounds and picking up litter.
Before the old flagpole had been recovered, Keep Scotland Beautiful, the team who issue the eco flags, had been in touch and had already sent a replacement.
The school was also contacted by one of the UK's oldest flagmakers, Zephyr, who read about their plight on the Evening Times website.
They had offered to replace the school's flagpole, which would have cost around £200, and also donated two new flags with the school's crest on them.
However, Mr Hardie has since contacted the company to tell them their old flagpole has been recovered.
He added: "It was lovely to know people were interested enough to lift up the phone to say 'can I help you?'.
"We showed the kids the two new flags from Zephyr and they love them.
"We might need another flagpole to fly all the new flags."
Carole Noble, head of operations at Keep Scotland Beautiful, said: "We were very saddened to learn the green flag and flagpole had been stolen from St Paul's.
"We were delighted to hear the originals had been found and are back in their rightful place."