What’s the difference: "I didn’t do anything" vs "I haven’t done anything"

Imagine the following scenario:

I looked at a girl and gave her a smile. My friend next to me has put a serious look on his face and is staring at me. I turn to my friend and figured that I'd say one of these two versions, but I don’t know which.

  1. I didn’t do anything.
  2. I haven’t done anything.

Which of those is better and when? Is either one actually wrong, or do they mean different things?

What about these others:

  1. I’ve done nothing.
  2. I did nothing.

Or even these:

  1. I wasn’t doing anything.
  2. I was doing nothing.

Solution 1:

One way to compare subtlely similar phrases is to look at a scenario where only one of them makes sense, as in:

I haven't been doing anything. (OK)
I didn't doing anything. (WRONG)
I wasn't doing anything. (OK)

So clearly "haven't" can be used for ongoing action whereas "didn't" cannot.

Apart from that, they are usually best used to match the question:

What have you done? I haven't done anything.
What did you do? I didn't do anything.

In answer to your question, if you were responding to a non-verbal cue, I would say either is as good as the other.