We had this problem both in 3.5 and Pathfinder..... It isn't difficult if you just follow the recipe.
1) Take the (dead) character's stats, remove any racial adjustments to
the physical stats. (If the character is one that get's to 'choose', and chose a mental for his +2, he/she lucks out) Also remove any physical (i.e. Dwarven darkvision, Elvin low light vision, etc.) The things that you would think a member of the race would have even if it was raised in a vacuum.
2) Apply physical adjustments to stats as listed on chart, do not adjust mental stats.
3) Look at the race in proper book. Add to character any physical abilities. Thing like Darkvision, Stability, Light Sensitivity, Fly Speed, etc.) The things you would think a member of that the race would have even if it was raised in a vacuum.
4) You keep you current mental abilities. Former Humans keep their racial bonus feat, and still get the +1 skill pt. Former Dwarves keep their racial training and hatreds (even though those foes may not get theirs again the character in its new body.)
5) Do not add racial hit dice, or anything that derives from racial hit dice (like BAB).
6) If the character gets spell like abilities (like a gnome), they get them, and can cast them as a member of that race would (using character level to replace racial hd, if necessary)
The biggest thing to remember is work with your GM to determine what abilities are Physical, and what are Mental. In our campaign we had a long discussion about whether the Dwarves Stone Cunning was mental or physical. We decided it was part of the magic of Dwarves, thus physical. It can just as easily be argued that it is learned, thus mental.
This spell has great role playing possibilities, as we have discovered. For example, we had a human paladin get reincarnated as a lizard folk, so she got +2 str, +2 con, +5 natural armor, 15' swim speed, the racial bonus to swim due to swim speed, a bite attack, and the Hold Breath special ability. She kept her human mental state. So when she was courted by a character of draconic decent, she just couldn't find him attractive, he looked like a big lizard to her. She ended up with a human lover, who didn't have the hangup about her being a lizard. But the main point is, she didn't expect the character to end up a lizard folk, she didn't plan for it, but she sure had FUN with it for over 3 years as we worked our way through the Shacked City adventure.
In my latest campaign, Age of Worms, I had a guy playing an Elf Wizard, who was prejudiced against anyone not an elf. The character was a real prick. (The player wasn't, it was rollllPlllayyy). He died, was reincarnated as a Half Orc. Still prejudiced as hell. He died again, was reincarnated as a Kobold. Even more prejudiced, cause now he was getting real angry at the world. Died again, in the very next encounter. Player was ready to through the character out, but another player talked him into Reincarnating 1 last time. Came back as a Dwarf. Character (and player) decided he was being punished by his God for his attitudes. Changed his Alignment to Lawful Good, and is working on being humble and non judgemental. The player is having a blast, and so is the rest of the party. (During this time, the doomed lovers, a Chaotic Good female human rogue type died and became a Dwarf, her Lawful Neutral male human knight lover died trying to save her, and became a Half Orc, and she still expects to marry him.....)