You have made a serious error. Trying to redirect your attention to how well you did previously in the class is not going to help, since all of that work is now suspect. Your professor is likely feeling betrayed partially because you did look like a promising student.
I don’t know what the specific disciplinary procedure is at your school, but you will likely want to speak with your academic advisor. However, don’t anticipate that you’ll be allowed a retest, or even a penalty-free withdrawal.