When T256001: Detect manual reverts completed, MW started marking manual reverts with an appropriate change tag. Once T254074: Implement the reverted edit tag completes, the same will be true for reverted edits.
This is fine, but existing installations won't have these tags populated on old edits. I propose writing a maintenance script that would go through all edits on a wiki and determine which are manual reverts and which were reverted.
I propose to combine this into a single script, as the use case is similar and running it all at once will allow for some optimizations. Turning off parts of the script as an option should be possible.
We could reuse the code that's present in EditResultBuilder and construct the object for every revision on a page. That would have horrible performance, though. I think it would be faster to obtain revisions in batches from the DB and then operate on a in-memory array of them. We would need just rev_id and rev_sha1 fields really, so we probably don't have to grab entire rows.
To mark reverted edits, we would have to detect the revert first, so it would only be possible to detect manual reverts, rollbacks and exact undos. Then we could mark the reverted edit appropriately.
I'm not sure if Wikipedia would be interested in using such a script, as it would be probably quite slow for them. I'm also not sure if it should be included as a part of 1.35 to 1.36 update by default. I guess keeping it as an option to wikis and announcing it in release notes would be fine as well.