It’s a bit fiddly, but it depends on how much of the fabric is missing and on how the yarn behaves. I’m basically threading/sewing a new length of yarn the same way the old yarn went before breaking. It helps to practice duplicate stitchimg before something breaks.
I made a tutorial:
For the sock with the pink mend I used the same general idea as my second example. I used smooth cotton yarn to have something that could hold the stitches while I remade them. If you don’t pay attention to what way the yarn should go through the loops the new ”stitches” will be twisted.
I had some issues but decided to just go over once more and duplicate stitch over the wonky ones. Hopefully it will not be too wonky to walk on.