Professor falsely accusing me of cheating in a class he does not teach, two months after end of the class. What precautions should I take? I'm a domestic student in the US. Despite my poor English, it's my first language.

In May 2019, I finished a class on web development.
My final submission was a simple but fully functional web app.
The professor of the that class seemed happy with my work (and the work of my classmates) and gave positive feedback. No one was accused of plagiarism. It was a small class with only five people, we all know each other fairly well and I don't think anyone cheated. I know I certainly didn't.

This summer I am taking another class, which is co-taught by Prof X, who has made it clear that he thinks I am an idiot. Prof X is also one of the co-chairs of my program.

Last week, I asked Prof X a question. He scoffed at me and asked me how I completed the web-development class if I didn't already know the answer to the question.
I told him I had completed it just fine. Then he told me I couldn't possibly have completed the final project. I told him I did. I asked him the question again.
Then he asked me what my grade was in the web development class. I got an A, so I told him that. Normally I wouldn't get into it but I was happy with the grade.
I was not able to get an answer to my question.

This week I found out that Prof X is starting a formal university disciplinary process against me.

I didn't cheat and I can prove it. I have all the code I wrote for the project and it's in my GitHub in a private repo so it was all version-controlled. I also have the presentations I gave to the class that show the work in progress. The web-development class's professor would vouch for me if needed, I'm sure of that.

While I think this is likely to blow over and not result in any problems for me, what are some precautions I should take just in case?



Bringing info from OP's self-answer below up into the question:  

@MichaelKay - "my guess would be that you wrote the code and got it working despite not understanding some fundamental concept of WHY it worked; and the Prof, having a more theoretical mind-set than yours, can't imagine the possibility that people can get code working without understanding the theory."

I accept that I may not understand some fundamental concepts of why it worked. However, Prof X is not a computer science professor and by his own admission is not a programmer. The class I'm taking this summer is in psychology and that is the area of research of Prof X.

"It would help to know exactly what the question was."

Sure, without going into too much detail about the coursework, I had asked for help with my presenting skills. My question did not have anything to do with programming. The class I'm taking this summer is in psychology, no programming involved.

Prof X has never criticized my coding skills, only my ability to pass the web development class based on my question about giving presentations.

@Bey - This isn't a major research university, it's a medium-sized state school. Prof X is not a department chair, he is one of the co-chairs of my program specifically, not the whole department. I can't drop the course as it is past the drop date now. But regardless, Prof X is one of three professors teaching this class and the other two seem to think highly of me so far, so I am less concerned about the grading.
@JeffE recommends in a comment:


  Discuss your situation with the department chair and your previous instructor, and keep careful documentation of everything.