No easy treatment
Hamstring injuries are difficult.
I recommend staying off it for the first 1-2 days, lots of ice and then you want to start walking with shortened strides and partial or full weight depending on how bad it is. It takes time for the muscle to heal and therapy can often be helpful at this stage. Eccentric type exercises have been shown to be helpful for preventing hamstring injuries.