OK, to increment every element from the previous by its absolute matnitude change is I guess what you're asking to do...
In this, then,
every point is the previous plus the change from the previous as if it were still growing rather than being cyclic; or, iow, as if you had rectified the signal.
NB: IF the data are a column you don't need the (:); I used it to ensure knew the orientation of the result from diff to do the concatenation with the first element.
W/ the revision of what the "reset" really is (I had presumed a sampled waveform, not the ramp)...
This ignores the ramp between the end of one cycle and beginning of next--those two points are same. If you don't want that plateau, you can estimate a slope and introduce an estimated dy at each break instead of setting to zero to cancel the reset.