Hi Anneli,
The Unpost Batch function looks at the GL Posted Transactions file to rebuild and generate the new batch. Within this data file is a Batch Number and Entry Number, which are both used to rebuild the new batch. Within each batch entry are Lines (one per GL account) that are basically the lowest level detail. This Line number is not stored in the GL Posted Transaction File, so there is no way for the Unpost function to be able to have the Lines within an Entry sorted in identically the same way they were before posting. The Entries will be sorted as before, but not necessarily the Lines within.
What this means is that the Generated Batch created by Unposting will be sorted by Account/Dept code within each entry. It does not use the Reference, Description or any other field within the batch.
So if I understand from your question, the Lines within an Entry were sorted by Check Number, but now that the Lines have been generated in Account order, the check numbers are no longer in sequence. I do not believe that Unpost can sort Lines in any way apart from account/dept order.
If I am wrong in my evaluation of your question, could you provide some specifics as to the original batch and the Unpost-generated batch? Perhaps something like:
In Batch 3 and Entry 1, Line 1 was for account 5000 and chk#123. Line 2 was for account 1000 and chk#123. Line 3 was for account 5000 and chk#124. Line 4 was for account 1000 and chk#124. When Unposting this batch, the lines for account 1000 were listed first, followed by the lines for account 5000.