Affective memories associated with the negative emotional state experienced during opiate withdrawal are central in maintaining drug taking, seeking, and relapse. Nucleus accumbens (NAC) is a key structure for both acute withdrawal and withdrawal memories reactivation, but the NAC neuron coding properties underpinning the expression of these memories remain largely unknown. Here we aimed at deciphering the role of NAC neurons in the encoding and retrieval of opiate withdrawal memory. Chronic single neuron and local field potentials recordings were performed in morphine-dependent rats and placebo controls. Animals were subjected to an unbiased conditioned placed aversion protocol with one compartment (CS+) paired with naloxone-precipitated withdrawal, a second compartment with saline injection (CS-), and a third being neutral (no pairing). After conditioning, animals displayed a typical place aversion for CS+ and developed a preference for CS- characteristic of safety learning. We found that distinct NAC neurons code for CS+ or CS-. Both populations also displayed highly specific oscillatory dynamics, CS+ and CS- neurons, respectively, following 80 Hz (G80) and 60 Hz (G60) local field potential gamma rhythms. Finally, we found that the balance between G60 and G80 rhythms strongly correlated both with the ongoing behavior of the animal and the strength of the conditioning. We demonstrate here that the aversive and preferred environments are underpinned by distinct groups of NAC neurons as well as specific oscillatory dynamics. This suggest that G60/G80 interplay-established through the conditioning process-serves as a robust and versatile mechanism for a fine coding of the environment emotional weight.