The most important part of a well-formulated ketogenic diet is to limit carbohydrate intake. People’s carb tolerances vary, so your carb-up may not have been as disastrous as it appears. You can take some comfort from that thought.
Remember that, whether your goal is metabolic health or fat loss (and the two are related), what makes a ketogenic diet work is that it gets us to eat in a way that lowers our blood sugar and our insulin levels. These are good things in their own right, and lowering insulin has the added advantage of making the energy in our fat tissue available, since a high level of insulin in the blood signals our fat tissue to hang on to fat. The trigger to high insulin seems to be carbohydrate intake above a certain amount. We recommend not eating more than 20 g/day, because that’s a level that works for everyone but those with really badly damaged metabolisms. So even if your personal carb tolerance is higher, 20 g/day is a good level to start at, because it almost certainly guarantees success.
There are ways to cope with lowering carbohydrate. First, replace all those carbohydrate calories with fat calories. Fat has almost no effect at all on our insulin secretion, so it is a safe source of calories. Protein can have an effect on insulin, but it is essential to the diet and we do need a certain amount of insulin in order to survive (just not too much!), so we pretty much leave protein out of consideration, except to eat a reasonable amount. Since fat has over twice the calories of carbohydrate, it doesn’t take as much to get the same amount of energy.
If you stick to leafy green and cruciferous vegetables (broccoli, cauliflower, etc.), you can eat quite a bit and still stay under 20 g/day. Certain berries, such as blueberries and strawberries are okay, as are walnuts and almonds, if we don’t go overboard. If you are getting enough fat to avoid hunger, and sticking to “safe” carbohydrates, you should be reasonably capable of avoiding sweets. The cravings won’t necessarily go away entirely, but they are a lot easier to manage if we’re not hungry, believe me. And carb cravings can often—though not always—be assuaged with fat and salt. (Think pork rinds, buttered cheese, bacon, etc.)
One last trick that helps me is not to swear off sugar and carbohydrates for ever. Just don’t eat any right now, and you’ll be fine. You can have all you want tomorrow! Even the worst sugar/carb addict can go 24 hours without a hit. And as I heard a gentleman say, on the occasion of the thirtieth anniversary of his last drink, “The world’s record for sobriety is 24 hours—it’s just that some of us have more world’s records than others.” So just keep on accumulating those 24 hours free of sugar, and keto on!