@HockeyGuy96,
End one relationship before starting or restarting another. If you don't want to be with the baby mama anymore, then go. Get an agreement drafted by a mediator or lawyer (in case your state does not allow binding agreements by mediators) and make sure to financially and emotionally provide for your daughter. Be cordial with the baby mama and continue to do so. This will go a long way toward being 'the best dad that (you) can be'. I also suggest this because entering into an affair essentially teaches your daughter that relationships and feelings are disposable. They can (and do) end, but it doesn't have to be a scorched earth policy. But sneaking around just teaches her how to cheat (and yes she will find out - kids aren't stupid or clueless).
As for your ex, it may or may not work out. Understand that you may have fuzzy, hazy nostalgia for something that was not as wonderful as you might remember it. Know that there was some sort of a reason why it ended between the two of you - don't whitewash that. It's part of the reality of the relationship dynamic with her.
You might end up with neither of them. Worse things have happened in the world, which will not end if you don't have either of them.
But take care of your daughter first, no matter how your love live goes.