-다가 marks an action broken off or turned around partway, so 갔다가 돌아오다 is going somewhere and then returning — six of these eight lines. 갔다가 돌아오는 길에 ('on the way back from') is the phrase you will hear most: 시장에 갔다가 돌아오는 길에. It also works for stepping over a line and stepping back: 어떤 선을 잠깐 넘었다가 돌아오고.