Voltage-gated K+ channels function in macromolecular complexes with accessory subunits to regulate brain function. Here, we describe a peptidyl-prolyl cis-trans isomerase NIMA-interacting 1 (Pin1)-dependent mechanism that regulates the association of the A-type K+ channel subunit Kv4.2 with its auxiliary subunit dipeptidyl peptidase 6 (DPP6), and thereby modulates neuronal excitability and cognitive flexibility. We show that activity-induced Kv4.2 phosphorylation triggers Pin1 binding to, and isomerization of, Kv4.2 at the pThr607-Pro motif, leading to the dissociation of the Kv4.2-DPP6 complex. We generated a novel mouse line harboring a knock-in Thr607 to Ala (Kv4.2TA) mutation that abolished dynamic Pin1 binding to Kv4.2. CA1 pyramidal neurons of the hippocampus from these mice exhibited altered Kv4.2-DPP6 interaction, increased A-type K+ current, and reduced neuronal excitability. Behaviorally, Kv4.2TA mice displayed normal initial learning but improved reversal learning in both Morris water maze and lever press paradigms. These findings reveal a Pin1-mediated mechanism regulating reversal learning and provide potential targets for the treatment of neuropsychiatric disorders characterized by cognitive inflexibility.