This is a bug that has been around forever. I have filed many bug reports on this and so have several others. They refuse to do anything.
https://developercommunity.visualstudio.com/t/Visual-Studio-randomly-modifiesreverts-/10782463