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 run the arduino IDE as an administrator and set to run compatibility as windows 7 (i'm currently using 10). i then changed the programmer to AVR ISP (i don't think this matters, but i changed it anyway) and now all is working again....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)