If you SAY that you DID NOT do something, it the same as if you DENY that you DID do it.
He said, "I didn't steal anything".
Using the reported speech formula, where we change from direct quotation to indirect:
He said that he hadn't stolen anything.
Now if he said that he hadn't,...