I kept it in the yard until it started freezing outside and then I trimmed most of the branches off of it and brought it into my sunny dining room, still with tomatoes growing on it.
Once all those tomatoes were ripe I cut the rest of the branches off and just left it.
Well, it's grown all new branches and has flowers all over it again.