One of the must-have utilities for developers is a clipboard history tool. There are a couple of good ones for the Mac. The one I use is a freebie called JumpCut, which gives you a clipboard with 100 entries.
Another option is iClip, which gives you history on more than one clipboard. I used to use it (it's commercial but cheap) but they recently updated it and went overboard on the eye candy. And, I found after using it that I'm fine with a single entry, simpler one.
Whichever you choose, it's worth spending the time to start using it regularly. Using a clipboard utility changes the way you work. You stop worrying about copying stuff that you might not need, and you stop use the clipboard as a data transfer for batch operations (copy, switch, paste, switch, copy, switch, paste, ad nauseam). In fact, I now proactively put stuff on my clipboard in case I might need it in a few minutes.