That is quite tricky business, but here is a possible way to do what you want:
reset_timestep 0
compute com mygroup com
fix com all vector 1 c_com[1] c_com[2] c_com[3]
variable step equal (step<1)+step
variable cx equal f_com[v_step][1]
variable cy equal f_com[v_step][2]
variable cz equal f_com[v_step][3]
Here the variables cx, cy, and cz will contain the values of the com compute of the previous step, exept for the first step.