An affirmative defense is one that goes beyond simply saying something to the effect that "I didn't do it." Instead, an affirmative defense actually presents new facts to the court. This can be done in a civil or in a criminal case.
In a criminal case, a defendant may bring up facts that (the defendant claims) mean that he or she cannot be found guilty. For instance, the defendant can claim to have an alibi. Or he or she can argue that they were drunk when the crime was committed.
In this way, an affirmative defense goes beyond simply denying the facts set out in the indictment. Instead, it brings in new facts that, it claims, show the defendant is not guilty.