You will always lose muscle when dieting, you just have to try to minimize it. The exception to this would be if you had been clean and you get back on when you start dieting, you will probably have more muscle mass than when you were clean. Your body comp will change favorable. Even at that, it depends on how lean you are trying to get. If you are trying to get into contest shape you will lose muscle period.