Relation between Terminal Voltage and EMF of a cell while the cell is being charged I know the relation between the terminal voltage, V and emf of the cell, V' while charging given by
V = V' + Ir
where I = Current in the circuit and r = Internal Resistance of Cell
Can anyone please explain why in charging a cell, the sign changes from - (which is when the cell discharges) to +  in detail by deriving the formula ?
Thanx in advance

@Farcher Can u explain/deduce that formula(V = V' + Ir) on the basis of following diagram:-

The diagram shows a cell of emf, V' and internal resistance, r being charged up by a charger.
 A: To drive a current through a ideal cell (no internal resistance) from its positive terminal to its negative terminal requires there to be an external voltage source which exceeds the emf of the cell $\mathcal E$ by an infinitesimal amount.
However with a cell that has internal resistance $R$ an extra potential difference must be applied across the cell terminals to drive the current $I$ through the internal resistance $=IR$.
So the total applied potential difference across the cell must be $V = \mathcal E + IR$.
It might be clearer if both sides of the equation are multiplied by the current $VI = \mathcal E I +I^2R$.
Now $VI$ is the power being delivered by an external source to the cell.
$I^2R$ is the rate at which heat is produced due to the cell having an internal resistance.
$\mathcal EI$ is the rate at which energy is being supplied to the cell to reverse the chemical change which the cell uses when it is discharging (converting chemical energy into electrical energy.
Now doing the same when the terminal potential difference is less than the emf of the cell.  
$V= \mathcal E - IR \Rightarrow VI = \mathcal E I - I^2R \Rightarrow \mathcal E I = VI + I^2R$
$\mathcal E I$ is the electrical power supplied by the cell from the chemical reaction within the cell.
$I^2R$ is again the rate at which heat is produced due to the cell having an internal resistance.
$VI$ is the power delivered to the external circuit by the cell.
So in one case (discharging)  the cell is producing the electrical energy from chemical energy and in the other case (recharging) the cell is consuming electrical energy which is being converted into chemical energy.
