While I have far more sympathy for the Greeks than the Germans in their current standoff, this Vox post helps make the point that it's quite hard to say which referendum outcome would lead to better state of affairs down the road.
If the EU's future will be just like its present, and if the Greeks would be able to manage an independent budget and currency, then exiting the Euro (which a No vote would make more likely) strikes me as the significantly better choice, even though the next few years would be gruesome.
But on the other hand, if the EU were to evolve into a true fiscal state in which Germany would help out Greece the next time around, in the same way that boom areas in the U.S. help out bust areas via automatic fiscal policy instruments, and if a fully autonomous Greek state would have serious governance problems, the merits could lie in the other direction.
I am skeptical that EU internal governance will evolve the right way to make staying with the Euro a good choice for Greece, instead of just a recipe for endless austerity and disregard of their interests relative to those of more powerful countries. But who really knows on either front.