’Tis better to have loved and lost than never to have loved at all.
Alfred Lord Tennyson
We’re all ships on the sea of life. Sometimes we just pass each other in the night. Sometimes we sail together for years on the same route, and end up docking at the same port. And sometimes we sail with each other only for a time. Maybe s|he had a change of course due to outside factors bigger than both of you. Maybe the arcs of your paths overlapped, and it only looked like you were going the same way long term.
Enjoy the time you had, learn from it, and try to get back to concentrating on your own journey. You can only change your own path. If you spend all your time looking back, you might well miss the next ship going your direction (or hit an iceberg!).