PCB Design for Rapid Charge/Discharge of Capacitor
That resistor will drain continuously your capacitor, so it will charge up and then slowly discharge. Also be wary of the gate requirement of your P-channel mosfet, unless you are charging to 5V you'll need to translate the level.
What do you need, as already commented, is two mosfet, a P-channel for charging and an N-channel for discharging. This is usually known as half-bridge and it's widely used for controlling, like, everything.
When using dedicaded ICs you can use an N-channel even for the high side (N-channels are cheaper and works better, but you need a floating Vgs to drive them).
They actually sell packages with one, two (brushed DC motor), three (brushless motor control) and maybe more half legs with all the drive circuitry and protection needed. Just supply a logic level. Major IC manufactures make them, I'd start with ON Semi, Infineon, Allegro and even TI (not an exhaustive list, of course)
Be careful with caps since the surge current can be quite big. Sometime for the discharging part only SCRs are used since they tend to perform better for the job.