Charge a capacitor with negative pulse
It depends on your capacitor and the corresponding circuit. All capacitors have built-in series resistance (ESR), and the corresponding RC circuit (not to mention the rest of your design) will either smooth that spike into a tiny bump, or it'll look almost identical to the input. Different capacitor sizes, types, and even the physical dimensions will impact their transient response.

The physical design of the capacitor will also react differently to negative voltages. Standard ceramic capacitors won't care about negative voltages as long as the amplitude is within their design parameters. If your capacitor is polarized - like a tantalum or electrolytic capacitor - a negative voltage for an extended period will make it explode (although a small transient like what you have pictured is probably just fine)

You might also look into a Coulomb Counter for your design - they're designed to track the charge of batteries, but some are extremely accurate and will factor in their own consumption.