Hungarian flag is so similar to the Italian one :)
I've learnt the other way... While the red-white-green colour combination was a long living tradition, the triple banded flag was taken in honour of the Italian freedom fights in the Reform age, turned and reversed in sequence to make it different enough but present the solidarity. (And both Italian and Hungarian flags were devised in honour of the French Revolution.) I have to admit that this theory is debated, but it has the same strong roots as the other theory that states it is elder to the Italian tricolor and coming from the time of King Matthias.
Previously Hungary used many versions of Red-silver (red-white) flags and coats-of-arms, and green came to the scene in the early 1800s. Before the revolution of 1848 the official state flag was white with red and green wolf teeth pattern on its edges and coat-of-arms in the middle. Its derivatives are official military and naval flags now.