"The Green Medicine will restore some of Link's Magic power."
A Link to the Past
The Medicine of Magic can be bought from Syrup at the Magic Shop in A Link to the Past. It costs 60 rupees and can be held in an empty bottle. The Waterfall of Wishing Fairy and Cursed Fairy both fill an empty Magic Bottle with Green Potion if thrown into their Mysterious Ponds.
Ocarina of Time
The Wind Waker
Cauldron of Green Potion from the Magic Shop in A Link to the Past