soak him in some lukewarm sugar water and keep the hemipenis lubricated with something like petroleum jelly or triple antibiotic cream. if it doesn't right itself after 48 hours or so of soaking and being lubricated you may need to take him to see a vet. most importantly, make sure that the hemipenis doesn't dry out or he may lose it.