Animals form and update learned associations between otherwise neutral sensory cues and aversive outcomes (i.e., punishment) to predict and avoid danger in changing environments. When a cue later occurs without punishment, this unexpected omission of aversive outcome is encoded as reward via activation of reward-encoding dopaminergic neurons. How such activation occurs remains unknown. Using real-time in vivo functional imaging, optogenetics, behavioral analysis and synaptic reconstruction from electron microscopy data, we identify the neural circuit mechanism through which Drosophila reward-encoding dopaminergic neurons are activated when an olfactory cue is unexpectedly no longer paired with electric shock punishment. Reduced activation of punishment-encoding dopaminergic neurons relieves depression of olfactory synaptic inputs to cholinergic neurons. Synaptic excitation by these cholinergic neurons of reward-encoding dopaminergic neurons increases their odor response, thus decreasing aversiveness of the odor. These studies reveal how an excitatory cholinergic relay from punishment- to reward-encoding dopaminergic neurons encodes the absence of punishment as reward, revealing a general circuit motif for updating aversive memories that could be present in mammals.