Texture paint undo steps don't work properly when mixed with memfile undo (object mode operations).
- Default cube.
- Set texture paint mode, add 'Base Color' slot for painting.
- Make one stroke.
- Undo everything, redo everything.
- All correct.
Now switch to object mode and undo, notice the image has been cleared.
Note that this is more of a limit in how image undo works than some mistake in the code. since 2.7x never supported this.
Image painting is an exception that needs special handling since it has undo data that exists outside global undo.
Reporting because this should be fixed before 2.8x release, or worse case we could limit texture paint undo/redo to the current painting session as 2.7x (would be a shame, but better then loosing the users work).