The first flag of Germany was adopted in 1848, at the time when Germany's states were in the process of trying to unite.  Although the union never occurred, a flag comprising equal widths of black, red, and gold was established.  The three colors were the same colors that appeared on the uniforms of German soldiers during the Napoleonic wars.

When the states were finally united in 1871, the colors were replaced with black, white, and red.  However, after a German republic was finally declared in 1919 following their defeat in World War I, the black, red, and gold flag returned.

However, just a little more than a decade later the flag was retired in favour of the Nazi party flag, which also became the National flag.  The end of the war welcomed the tricolour flag once again, but since East and West Germany had been divided, East Germany added its coat of arms.  The coat of arms was removed when the East and West reunified, and it finally looks like the original tricolour is here to stay.