Additionally, I receive a lot of questions from people who are worried about going back to their original stock file.
The fact of the matter is, yes BMW can detect abnormalities on the car. Regardless of what software you have, they can read previous over-revs, lean AFR's, high amounts of boost, etc. This is stored on the DME, so regardless of whether you have erased the aftermarket software, it is still there.
For an example of this, take a look at Audi and the TD1 codes. People who purchased cars CERTIFIED PRE-OWNED from an Audi dealership, are now having warranties voided. There is no software on the car and the car was advertised as stock, but due to previous over-revs and other factors (from the last owner), the car produced a TD1 code (Voiding the warranty).
Luckily, BMW has not gone to these measures. They have the ability to, and frankly have had this ability for years. I just tell our customers to switch the car to our GIAC "Stock" file before visiting a dealership, so it is just a hassle-free visit. Most dealerships don't try to bother with software, as time is money and it would take significant amounts of time and money to detect the presence of aftermarket software.
Luckily, if BMW does decide to go the route of Audi, we have the Magnusson Moss act that will protect us. The bottom line is that if the dealer is going to void your warranty for a software flash, it doesn't matter if the flash is currently on the DME. The abnormal values are already in the DME.