You can remove perks you currently have by using:
player.removeperk perkid
To find out the id of the perk, type this in:
help "perk name here" 0
This will bring up a list of all items matching your query (hopefully it contains the perk in that list).
To add a perk:
player.addperk perkid
Note: for perks that have multiple levels, you will have to remove all the perks for those skills to clear it out. i.e. one handed has 5 levels, the way skyrim tracks that is to add a perk for each level, so there are 5 different perks for one handed.
To redistribute your stats, you can use:
player.setav stat value
However this will not persist across saves, to do that use:
player.modav stat amount_to_modify_by
That can be used to set all skills and stats.