The function of a filter is to partially enable/disable data from a table. The filter tools in Calc also offer a quick way to sort the filtered data. Filtering is temporary. Sorting is permanent.
Filtering: Hide rows from view, and disable some operations on them, depending on content.
Filtered data stay in the same row. The row is just hidden. When filter is removed/disabled, what was hidden comes back into view. Your table is restored to “Normal”.
Sorting: Rearranging content among the rows, to satisfy a “proper sequence” depending on content.
Sorted data is moved to other rows as required. This is now the “Normal”.
Undo will usually work, but you may need to undo other operations (which you want to keep) first. The best way to have a “retreat option” from sorting is to create a “dummy field” in your table to preserve the original sequence (new column, fill with numbers in sequence) and sort on that field whenever you need to go back.