Yes, even if you had something surgical and you passed without glasses it can be removed.
For example, I wore glasses so had the restriction. Then I had lasik. The next medical I did it without glasses and received an unrestricted first class. Now over 15 years later my right eye has degraded some so I wear glasses most of the time. I walk into the AME with my glasses on, take them off to take the test, pass the test, and receive an unrestricted first class.
Do I fly without my glasses on? Nope, and I even have prescription sunglasses, but legally I could if I had to.