Problem with Unity's auto-upgrade system for shaders

We upgraded to 5.4, but for some reason, Unity has become extremely invasive with it’s API auto-upgrade policy. We definitely did the C# script upgrades, without much issue, but there are lines in our shaders that we do not want to be modified. They are specifically surrounded in #if UNITY_VERSION… blocks, so that the shaders work with multiple versions of Unity. But the upgrader, just auto-changes all the lines in those blocks. I’ve tried multiple times to revert, but it just keeps modifying the files, without any warnings to me.

Is there a way to circumvent this or disable auto-upgrading of shaders? This seems very broken.

From the 5.4 release notes:

Shaders: Added ability to exclude
shaders from automatic upgrade by
anywhere in shader source file.