An unhealthy diet does not and cannot cause a miscarriage. As far as I'm aware, there are no accepted studies that even suggest this.
Early miscarriages are usually due to chromosomal issues with the fetus and have nothing to do with what you ate.
First trimester eating habits are rarely healthy for most women. The food aversion and nausea mean we have eat what we can to keep our bodies going, some women can barely eat anything at all, some can only stomach unhealthy food and some can only eat bland food.
At your gestation, the yolk sac gives your baby the nutrition it needs. When you get further along, healthier eating, or at least a mire balanced diet, will be more encouraged but at this stage, just eat what you can when you can.
My first trimester wasn't the most fun and I was pretty unhealthy throughout. Only thing that helped my nausea was full sugar tango and salt and vinegar walkers crisps, so that was my main diet 😅 baby girl is fine and I'm healthier now.
Just take your folic acid and vit D (or prenatal if you're using something like pregnacare) if you can keep it down and try not to worry about your eating habits too much.