I also use a foam roller, gentle yoga stretches, and utilize The MS Gym
https://www.themsgym.com/
A heating pad for 30 minutes a night works wonders for me
Took me 4 days to work both my legs Hamstrings out. Stretching, ibuprofen, and determination.
Using a foam roller is working for me right now to release the hamstrings. VERY painful at first but when they loosen up the pain diminishes considerably.