How do I respec mid-game in Fallout 4? [duplicate]

It is not possible without cheating. With cheating you can choose your own perk levels though.

Type tilde (~) key to bring up the console. Then type player.setav variable amount

variable would be one of these:

strength

perception

endurance

charisma

intelligence

agility

luck

Then the number you would like that perk to have. Source: Steam forums

It is also possible to modify a value by a certain amount. for that use player.modav, but beware that this will NOT affect the perk chart whereas setav will.

Complete list of console commands Complete list of adjustable stats, including perks