We demonstrate a direct correlation between the charge state and photoluminescence (PL) intensity of individual CdSe nanowires by actively charging them and performing electrostatic force microscopy and PL measurements simultaneously. While the injection of positive charges leads to an immediate PL quenching, a small amount of injected electrons can lead to an increase of the PL intensity. We directly observed the migration of excess charges into the substrate, which leads to a recovery of the PL. Further, we show that the PL of individual NWs can be actively switched between on and off states by charging with the atomic-force microscope tip. We propose a model based on charge trapping and migration into the substrate to explain our results.