That all depends on how long you’ve been in ketosis. When you’re first starting out on a ketogenic diet, your body has no residual ketones built up in the event that you make the choice to have some carbs. In this case, you would most likely be back at square one. The nice thing about exogenous ketones though is that they can help push your body back into ketosis more rapidly, assuming that there wasn’t a mass overload of carbs.
After 3-4 weeks on a strict keto diet however, your body does build up residual ketones and can more easily recover from a little bit of cheating every once in a while. This too however would depend on the amount of carbs consumed, and the amount of residual ketones stored. Essentially, if you return immediately to a keto diet, the time it would take for you to return to ketosis would be only as long as it takes for your body to purge the excess levels of glucose created.
If you have cheated on your diet and you are worried that you overdid it, just remember to return to a keto diet as quickly as possible and if you really want to speed up your recovery, exercise and exogenous ketones go a long way towards getting your body back on track.