function undo()

global LASTCOMM BADBIN BADBIN_BAK BADPRF BADPRF_BAK ...
       BOTTOM BOTTOM_BAK LASTPLOT
if LASTCOMM == 'badbin'
  temp = BADBIN;
  BADBIN = BADBIN_BAK;
  BADBIN_BAK = temp;
elseif LASTCOMM == 'badprf'
  temp = BADPRF;
  BADPRF = BADPRF_BAK;
  BADPRF_BAK = temp;
elseif LASTCOMM == 'bottom'
  temp = BOTTOM;
  BOTTOM = BOTTOM_BAK;
  BOTTOM_BAK = temp;
end

eval(LASTPLOT)

