I created a rewind mechanic to implement in a small game. I choose to create a platformer game to show this mechanic. In the game there are environment puzzles that requires you to use the mechanic to go through.
The code can be transferred to other projects very easily since the system uses tags to determine which object to rewind. It can store the necessary information to rewind; such as transform, scale and the rotation. Also if necessary the velocity informations are stored as well. This system will take a lot of memory if we store to information for all the frames so I did optimizations to store limited amount of frames each frame and lerp through each of the information to get a smooth visual representation of the rewind.