You can't undo records once they are saved. In a datasheet, the record will
be saved once you move off that record.
One method that you can use:
You can use a temporary table as the source for your datasheet.
Write the records to be edited to the temporary table
Update the temporary table (and add records to it)
When you change the main form, write all the records back to the permanent
table (update existing records, add new records, and delete records marked
for deletion) and then clear the temporary table
If you want to cancel the changes, then you only clear the temporary table.