I had the same problem and finally managed to get my code to upload again. I uninstalled the IDE and drivers etc, installed it all again, then i runI ran the arduinoArduino IDE as an administrator and set to run compatibility as windows 7 (i'mI'm currently using 10). i then
I also changed the programmer to AVR ISP (iI don't think this matters, but iI changed it anyway) and now all.
All is working again....hopefully hopefully, this can help someone else out too.
(sorry, appreciate this already has a best answer, but none of the above tips worked in my case)