One of the funny things about these kinds of questions is you can often put them in the positive or negative with the same (or nearly the same) intent and the same result.
Did you come by here yesterday? / Didn't you come by here yesterday?
Both ask the same essential question. But the first one is more "openly questioning," while the second implies an answer and seeks to confirm it. "Untangled," the second is "You came by here yesterday, did you not?"
As question tags, your two versions also get slightly different tones. The first ones, with "did," could survive as questions with the "tag" shifted back to the beginning of the sentence and the "did" deleted:
He gave up his job?
This shows that it's not a "pure question," as we might have if the "did" were present. Rather, it's something you would say to echo a piece of surprising news and ask for confirmation: "He gave up his job." "He gave up his job?!"
The "question tag" version doesn't communicate quite as much surprise, but it fills a similar role, responding to news (whether delivered or implied). I might meet you and observe "Got a haircut, did you?" You didn't tell me you did, but it evident. Rhetorically, I might not need confirmation for something so obvious; this "positive question-tag" version is pretty much the same as a simple observation "You got a haircut," but perhaps more interesting conversationally, as it invites a response.
The "negative question tags" are more at home as a challenge. "You're the one who started the fire, aren't you? Admit it!" I don't actually know that you did; I'm not responding to news; I'm genuinely asking a question (even if also strongly reinforcing one possible answer). Even in a friendlier challenge, "You cut your hair, didn't you?", this implies that the haircut is less obvious and I do actually have to ask.
I have a hard time communicating intonation in writing but:
You cut your hair, did you? —the tag "did you" is lower in pitch than the earlier parts of the sentence, and rises toward the end.
You cut your hair, didn't you? —the tag is emphasized; "did-" is as high in pitch as the highest earlier point in the sentence; it falls toward the end.