Save the order or a column
Simply create an Index column.  1, 2, 3 etc. (As pjctec mentions in comments.). Without some ordered list or index, there is no way for Numbers to know how to use a custom sort.

There is no need to use a formula to create the list of numbers.


In A1 enter 1
In A2 enter 2
In A3 enter 3
Select cells A1 to A3
Drag the yellow dot down.


Sorting will not change the numbers as they are static.  No need to use a formula.

Then you can always sort the index column later.  If needed, the column can be hidden or shown when needed.

Apple supplies a good resource for Numbers basics on their Website. Numbers Help. Recommended for new users and anyone who wants to get the most out of using Numbers.