Reverse sort

Hello,
I have a large list of names and would like to do a reverse sort on them i.e. the sort should be by the ending and not by the beginning of the word.
I had written in awk a small script but it does wrong things

{ for(i=length($0);i>=1;i--)
printf("%s/n",substr($0,i,1)); }

Could anyone pease help me sort out the script.
Many thanks

Reverse a string - Rosetta Code

AWK

function reverse(s)
{
  p = ""
  for(i=length(s); i > 0; i--) { p = p substr(s, i, 1) }
  return p
}
 
BEGIN {
  print reverse("edoCattesoR")
}
Recursive
function reverse(s   ,l)
{
  l = length(s)
  return l < 2 ? s:( substr(s,l,1) reverse(substr(s,1,l-1)) )
}
 
BEGIN {
  print reverse("edoCattesoR")
}

Can you post a sample of input and the expected output.

Here is a quick and dirty:

$ cat infile
complaints
villagers
eventually
spank
previously
complaints
relevant
$ rev infile | sort | rev
spank
villagers
complaints
complaints
relevant
eventually
previously