If the order can change and the values in the field can change then there isn’t any way to match up the old rows with the new rows. In order to do this one of the values in the row would need to be unique and unchanged. Then you would need to loop over both the old value and the new value to find the right row.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users