The wrong side of jersey (T-shirt fabric) does the same thing: rolls back with no human intervention.
It turns out that there's a similar rolled edge in crochet. And it's just as easily made.
You just need to use a bigger hook at the edge for three or so rounds/rows. The fabric created by the larger hook will roll beautifully. In the example, above, I used a 5.5-mm hook for the hat and a 6.5-mm hook for the edging..