Undo mark

Hello,
Is there anyone could share an example about undo mark? I am going to create a trim and according to trim direction the mass will be changed. Whichone will result in the least mass measured then the flip trim direction will work for getting this.
Thanks

If you search for "undoToMark" on this site, you will get many examples of setting an undo mark and performing an undo as needed.