You can realize a large basin upstream, where you can divert the excess water during overflow time.
You can then opt for:
- leaking that excess water on a path avoiding the city, going through expendable areas
- let that water drain through the terrain
First one is preferred, as in case of exceptionally extreme cases, you might prefer flooding low value areas instead of the city. Of course you need to take care that no abusive buildings are built in the area designated for being flooded.