If I asked you to picture a surgeon in your mind's eye, you almost certainly would picture an individual in medical scrubs (most likely white or green scrubs), wearing a mask, etc. But it hasn't always been that way. Medical scrubs are actually a relatively modern practice.
Until the 20th century, surgery was (compared to today's standards) a rather crude operation, which did not really involve any sanitation, least of all anything like medical scrubs. Sterilization was not even a consideration, because there was really no understanding of how disease and germs spread. Many scientists believed in spontaneous generation, meaning that germs spontaneously generated from nothing. Little or no consideration was given to basic sanitation, so the mortality rate was very high.
Actually, many surgeons wore a butcher's apron, and since they did not don a clean one between patients, it would become very soiled by blood and fluids. So a dirty apron just meant a busy surgeon.
Around 1920, sanitation methods began to be employed in the operating room. By the 1940's, an increased understanding of operation sanitation motivated the introduction of sanitary drapes and attire for the medical personnel.
Originally, the scrubs were white, to emphasize and display their cleanliness. However, this presented several problems. First of all, red blood splotches were quite unsightly on white clothing. Also, the all white clothing, when coupled with bright lighting, cause eye strain. So they began switching from white to green clothing.
By the 1970's, scrubs had largely become what they are today: a short sleeve shirt and drawstring pants, in most cases, made of green cotton.
All medical scrubs are not green, though. Many hospitals color code their uniforms according to departments. For example, Emergency Room staff would wear pink, Surgery staff would wear green, and Labor and Delivery Room staff would wear blue. Or, in university hospitals, the staff may wear colors corresponding to the school colors.