Assume the charge in capacitor is q,  the current is defined as I=dq/dt
, then I=dq/dt> 0 while charging (I>0 means current flow into the capacitor),
and I=dq/dt<0 while discharging (I<0 means current flow out of capacitor).

If you defined I' mean current flow into the capacitor, then dq/dt=-I' while discharging (in this case: you got a negative sign of current I').