For the jota, first cover beans with cold water and soak overnight. The next day, change water and cook beans in it for at least 1 hour.
Cut peeled potatoes into cubes, add and simmer for another 20 minutes.
Meanwhile, in another pot, sauté finely chopped garlic cloves with flour in oil until a light brown roux forms. Add sauerkraut, diced bacon, caraway powder and bay leaves. Cover everything with water, season with salt and pepper and cook, stirring occasionally, until the liquid has almost completely boiled away.
Mix the cooked sauerkraut with the beans and cook with them for another 20 minutes. Salt, pepper and let stand overnight.
Reheat and serve jota only the next day.