In future DataStore upset events: set your game to Private and send some type of notice as soon as possible that a maintenance and a rollback will be occurring due to a “recent exploit” to prevent confusion. Doing this step as soon as possible will prevent players from losing too much progress from the time the exploit happened to now.
Under the same universe in Roblox studio, you can use DataStore:ListKeysAsync() to get all of the saved keys and DataStore:ListVersionsAsync() to get all versions from the past 30 days for a specific key. You can then compare the DataStoreObjectVersionInfo.CreatedTime with the time the attack occured. Once you get the last safe DataStoreObjectVersionInfo.Version, use can fetch that version’s data with DataStore:GetVersionAsync() use DataStore:SetAsync() to override all data. Optionally, can also use DataStore:RemoveVersionAsync() to mark data after the exploit as deleted.
This process may take some time depending on the amount of players you have, and you will have to code your rollback to account for limits (non-playtest Studio command line does have higher limits). You can track your budgets with DataStoreService:GetRequestBudgetForRequestType(). I would recommend testing your written code in another place first to prevent any mistakes from happening during the backup. In the future, we could also be getting a new method called GetVersionAtTimeAsync to simplify the backup process.
You may also use the Cloud API instead of Studio. Using the Cloud API also allows you to utilize the beta snapshot feature, which is useful before doing any changes to DataStores (such as data rollbacks) or pushing critical game updates.
Edit:
Lastly, consider rewarding your players for the big inconvenience. Nothing is more frustrating having to wait for hours just to fix a huge exploit that shouldn’t have happened in the first place only to have your data be rolled back. Make it worth their while and reward them with in-game currencies or items more than or equal to the time (potentially) lost as a token of apology.