That poor guy!! He looks so miserable and beaten up, makes me want to cry!! I agree with the advice given, crystal clean water, aquarium salt, high protein diet, and keep him somewhere dark and warm so he doesn't stress.
When I worked at walmart many years ago there were many times when I would get to work and someone had put 2 or more bettas in a cup. There was even one time when someone took one of the bowls off the self and dumped all of the bettas (there were like 6 males left) into the bowl!