Revert version on a type

I was wondering if it’s possible to revert the version on an instance of a versioned type. My instance got corrupted in V#8 and I would like V#9 to be the same as V#7. Is there a quick and easy way to make that happen?

This is related to the following question: How to fetch historical versions of an entity type
Get specific version of an object
@qiwei.li @venkata.paruchuri ?

Or would I need to manually go through versionEdits.reverseEditList.fieldEdits and loop through, reassigning the values from old to new?

Why can’t you use the getVersion API from the links you provided, them upsert it back to replace current version? Doesn’t seem like you need to loop through all the versions prior to the one you need…

Thanks, Yaroslav- what you said is exactly what I ended up doing.

What I would have liked is to have a single function type.revert(id, version) that would do that for you. id would be the id of the type that I want to revert and version would be the version I want to revert to. Do you think it’s worth a feature request?

We don’t do this very frequently, and on most of our types versioning is not even enabled. If this becomes a frequent scenario for multiple use cases/customers, I would consider a feature request. Until them, two commands are almost as good as one :wink: