If your spouse or partner says they are thinking of breaking up, keep your cool and don't act desperate. Contain your surprise and agree with them. Saying that you have been thinking of breaking up too at this point can shift the advantage back to your side. When they break the news to you, they will expect you to come apart. They will not be expecting agreement from you, which can get them to reconsider their decision. If it works or not, you will have conducted yourself in a respectable manner making it easier later on to reconcile.
They want some time away from you, so give it to them. The reason they split with you is because they needed some "alone" time. They needed a little time away from the norm to think it all over. Give them some time to reset and think a bit and they may come running back before you know. Don't contact your partner at this point in the game, you will just make it more difficult to make up later on. Hasty or desperate contact can push them away faster.
When you are both ready to talk, after you have had some "cooling off" time, then see if you can work it out. Giving yourself, and your partner, some down time can make your conversations go much smoother and get you back on the road to reconciliation faster.
When you and your partner have both had enough time to sort things out a bit and he/she starts missing you, mention in casual conversation that you should go out on a friendly date sometime. Make sure they know there is no pressure, you just miss their company and friendship and would like to go have a bit of harmless fun. Don't mention reconciliation at this point in time. Keep your conversations friendly and light. The point now is to make them realize how much fun you can be and that they miss you, speaking of anything negative now can blow it.
Don't give them any reason to believe anything other than you are doing great and enjoying life. The more "together" you seem at this point, the more attractive you will be to them. If all is well, try another date in about a week or so. Take your time.
Play your cards wisely and take enough time to let things progress on their own, and you will stand a really good chance of getting your ex back. The worst case is that things don't work out in the end and you have retained a good friend in someone you dearly care about.

