user option magit-list-refs-sortby
For many commands that read a ref or refs from the user, the value of this option can be used to control the order of the refs. Valid values include any key accepted by the
--sort flag of
git for-each-ref. By default, refs are sorted alphabetically by their full name (e.g., "refs/heads/master").