1540s, probably from Old English wice "Applied generally or vaguely to various trees having pliant branches" [OED], from wican "to bend" (from PIE root *weik- (2) "to bend, to wind") + hæsel, used for any bush of the pine family (see hazel (n.)). The North American bush, from which a soothing lotion is made, was so called from 1670s. This is the source of the verb witch in dowsing.
by 1792, in the figurative sense of "person of bad character; member of some group guilty of offensive conduct that does little credit to the flock, family, or community to which he belongs," supposedly because a real black sheep (there was proverbially one in every flock) had wool that could not be dyed and thus was of less worth. But one black sheep in a flock is said to be considered good luck by shepherds in Sussex, Somerset, Kent, and Derbyshire. The first known publication of Baa Baa Black Sheep nursery rhyme is in "Tommy Thumb's Pretty Song Book" (c. 1744).
The American folk custom of wearing or displaying a yellow ribbon to signify solidarity with loved ones or fellow citizens at war originated during the U.S. embassy hostage crisis in Iran in 1979. It does not have a connection to the American Civil War, beyond the use of the old British folk song "Round Her Neck She Wore A Yellow Ribbon" in the John Wayne movie of the same name, with a Civil War setting, released in 1949.
The story of a ribbon tied to a tree as a signal to a convict returning home that his loved ones have forgiven him is attested from 1959, but the ribbon in that case was white.
The ribbon color seems to have changed to yellow first in a version retold by newspaper columnist Pete Hamill in 1971. The story was dramatized in June 1972 on ABC-TV (James Earl Jones played the ex-con). Later that year, Irwin Levine and L. Russell Brown copyrighted the song "Tie a Yellow Ribbon Round the Ole Oak Tree," which became a pop hit in early 1973 and sparked a lawsuit by Hamill, later dropped.
In 1975, the wife of a Watergate conspirator put out yellow ribbons when her husband was released from jail, and news coverage of that was noted and remembered by Penne Laingen, whose husband was U.S. ambassador to Iran in 1979 and one of the Iran hostages taken in the embassy on Nov. 4. Her yellow ribbon in his honor was written up in the Dec. 10, 1979, Washington Post.
When the hostage families organized as the Family Liaison Action Group (FLAG), they took the yellow ribbon as their symbol. The ribbons revived in the 1991 Gulf War and again during the 2000s wars in Afghanistan and Iraq.