A thoughtful design and implementation of an Undo/Redo feature is really valuable to your users. Don’t miss this opportunity to surprise and delight!
Here are a few pointers that you may find useful:
On iOS/Mac, definitely take advantage of the Foundation UndoManager API to keep track of things. It makes your logic easier to follow and the resulting implementation more robust. You can find a good sample here.
On Android, there isn’t an official/prescribed approach. This Regret framework does make thing a little easier.