YOU SAID:
He said that he didn't do it but I know he did.
INTO JAPANESE
彼はそれをしなかったと言ったが、私は彼がしたことを知っている。
BACK INTO ENGLISH
He said he didn't do that, but I know what he did.
INTO JAPANESE
彼はそれをしなかったと言ったが、私は彼が何をしたか知っている。
BACK INTO ENGLISH
He said he didn't do that, but I know what he did.
That didn't even make that much sense in English.