In both Marvel continuity and the Skáldskaparmál Loki shaves Sif's hair as a prank. After he gets in trouble he promises to have a headpiece made of gold to replace it.
The dwarves make this for Loki and Sif in the Skáldskaparmál. In Marvel continuity, Loki made the deal with trolls and the trolls cursed the hair that if Loki reneged on the terms of the contract with them, it would turn black. Loki stole the hair replacement without paying and now Sif's hair is black.
Because Sif was so vain and whining and crying about her hair colour change, her parents got sick of her and sent her off to be a warrior instead of the actual Godess of farming and fertility she is in the Norse legends.