We're all used to flat and sharp signs, also naturals. Accidentals in some cases. But why those unusual signs? I suspect the ♭ may have something to do with the German B, but the ♯ sign? Something to do with the German H? Otherwise known as hash, or, properly 'octothorpe', coined by a telephone company in the '60s. And the natural ♮ seems to almost be a mixture of ♭ and ♯. What's it all about?
Medieval German notation for modal music (for all instruments and voices, not just for fretted stringed instruments) was essentially tablature, but using letter names for the notes instead of fret numbers as in modern tab notation. In early modal music, the only "altered" notes were B flat and B natural, which were written using different "square" and "round" shapes of the gothic letter b. These signs were not "accidentals" in the modern sense, but single signs representing the two different pitches of the note. The "square B" later became the gothic letter h, and H is still used in modern German as the name for "B natural" - B means "B flat".
When notation was needed for accidentals on other notes, the "round" or "soft" form of the letter b was used as the sign for a flat, and the "square" form for a sharp.
The original sign for "sharp" was written using diagonal lines, like an x with double strokes. I don't know when or why the "single sharp" became more vertical, and the modern diagonal "double sharp" was first used.
The modern names for "sharp" and "flat" in most European languages (except English) are translations of the German "square B" and "soft/round B".
In early music, there was no great need for a special sign for "natural". Later, the "square b" sign evolved into two different signs for "natural" and "sharp".
Early music notation was not pedantic about for how long an accidental stayed in force (the modern concept of "until the end of the bar" would have made little sense, because bar-lines were not used systematically before the late 16th century). Before the development of a separate "natural" sign, a sharp was used to "cancel" an earlier flat, and vice versa. Traces of this convention were still in use in some of JS Bach's manuscripts (and in some cases were misinterpreted when Bach's music was re-discovered in the 19th mid century), and in some of the examples in his son CPE Bach's book "Essay on the true art of playing keyboard instruments." Even in the 20th-century, one English translation of the "Essay" printed some of these examples (which are nonsensical if interpreted using modern conventions) as they were originally written, with no editorial comment.
This close relationship between "natural" and "sharp" also applied to figured bass. "#" was often used to mean "a major third" even in keys were the intended note was actually a natural. (Modern figured bass notation, used for teaching harmony, tends to be more pedantic about sharps and naturals than when it was a "living" musical notation system.) This usage of "sharp" also survives in modern chord symbols - Ab7#9 doesn't literally mean "play a B sharp!
The signs are different forms of the letter B, which were needed as the different hexachords had different types of B's (namely, B flat and B natural). There isn't much more to say, Wikipedia has all you need.
Archaic forms of 'b', the b quadratum (square b, ♮) and b rotundum (round b, ♭) are used in musical notation as the symbols for natural and flat, respectively.
Because B♭ was named by the "soft" or rounded letter B, the hexachord with this note in it was called the hexachordum molle (soft hexachord). Similarly, the hexachord with mi and fa expressed by the notes B♮ and C was called the hexachordum durum (hard hexachord), because the B♮ was represented by a squared-off, or "hard" B. Starting in the 14th century, these three hexachords were extended in order to accommodate the increasing use of signed accidentals on other notes.
The different kinds of B were eventually written differently, so as to distinguish them in music theory treatises and in notation. The flat sign ♭ derives from a round b that signified the soft hexachord, hexachordum molle, particularly the presence of B♭. The name of the flat sign in French is bémol from medieval French bé mol which in modern French is bé mou "soft b". The natural sign ♮ and the sharp sign ♯ derive from variations of a square b that signified the hard hexachord, hexachordum durum, where the note in question is B♮. The name of the natural sign in French is bécarre from medieval French bé quarre which in modern French is bé carré "square b". In German music notation the letter B or b always designates B♭ while the letter H or h – a deformation of a square b – designates B♮.