Recently I entered a battle with a wild Pokemon that knew the move Entertainment. My Absol I was using knew the ability Justified, and Entertainment changed it to Klutz. Unfortunately, I have no way of changing it back to Justified, and I'm a little disappointed, because I adored that ability. I need to know if there's an item that prevents this from happening, because it's quite annoying and I don't want it to happen again.
Unfortunately, there is not an item that prevents ability changes from occurring in battle. However, as Hellfire Taco stated, the change of abilities, along with stats and certain status conditions, disappear at the end of a battle. Hope I helped!