Dr. Bashir says it's impossible to erase only select incidents from O'Brien's memory without erasing his entire memory. There are previous Star Trek episodes where a person's recent memories or selective memories were erased with a device by a doctor, such as done for Tom Paris in VOY: "Ex Post Facto", and done by Dr. Crusher on TNG more than once. Also a Vulcan could have been brought in to erase that portion of O'Brien's memory with a mind-meld technique, as that had been done by Vulcans in the past, such as Spock did for Captain Kirk in TOS: "The Paradise Syndrome", intoning "Forget".