For perks, find the ID of the perk you want to undo, one way to do this is in game, type in console "help perkname 0" without quotes and replace perkname with the name of the perk you wish to remove. A list of IDs should appear, scroll through them with page up and page down until you find one with "PERK" next to it.
Then type "player.removeperk ID" replace ID with the perk's ID you just found. Now you wont get a perk point back from doing this so you will have to find the ID of the perk you want by doing the "help perkname 0" again, then typing "player.addperk ID".
To alter your health/magicka/stamina, type "player.modav health/magicka/stamina #" only choose one of the attributes at a time and replace # with the value you wish to change it to.
It's quite easy, wont take you very long once you get the gist of it. Hope this helps.
Here's a few useful commands for doing respecs. You can certainly monkey around quite a bit more (changing your maximum carry weight, for example, or the cooldown on your dragon shouts), but I've only mentioned the one's you'd use if you just wanted to do a respec without outright cheating.