Where a defendant has served any portion of his sentence under a commitment based upon a judgment which judgment is subsequently declared invalid or which is modified during the term of imprisonment, such time shall be credited upon any subsequent sentence he may receive upon a new commitment for the same criminal act or acts.
(Added by Stats. 1949, Ch. 519.)