"to joust," 1590s, from tilt (n.1). Related: Tilted; tilting. The figurative sense of tilting at windmills is suggested in English by 1798; the image is from Don Quixote, who mistook them for giants.
So saying, and heartily recommending himself to his lady Dulcinea, whom he implored to succour him in this emergency, bracing on his target, and setting his lance in the rest, he put his Rozinante to full speed, and assaulting the nearest windmill, thrust it into one of the sails, which was drove about by the wind with so much fury, that the lance was shivered to pieces, and both knight and steed whirled aloft, and overthrown in very bad plight upon the plain. [Smollett translation, 1755]
negative particle, a word expressing negation, denial, refusal, or prohibition, mid-13c., unstressed variant of noht, naht "in no way" (see naught). As an interjection to negate what was said before or reveal it as sarcasm, it is attested by 1900, popularized 1989 by "Wayne's World" sketches on "Saturday Night Live" TV show.
Not, spoken with emphasis, often stands for the negation of a whole sentence referred to: as, I hope not (that is, I hope that the state of things you describe does not exist). [Century Dictionary, 1895]
To not know X from Y (one's ass from one's elbow, shit from Shinola, etc.) was a construction attested from c. 1930 in modern use; but compare Middle English not know an A from a windmill (c. 1400). Double negative construction not un- was derided by Orwell, but is persistent and ancient in English, popular with Milton and the Anglo-Saxon poets.