I am a little confused about the application of Faraday's law in a generator. If we imagine a magnet attached to a wheel (which spins when water falls on it) next to a coil, as the magnet spins around, current will be generated due to electromagnetic induction. However, when we measure the current, the needle on the galvanometer swings back and forth. Why doesn't the current cancel out when it goes from positive to negative on the galvanometer?
From what I understand maybe you mean that as the current keeps changing direction so why don't we say that the net current is 0 as there exist 2 equal and opposite currents.
Simply put it's because the currents are in opposite directions at different instances of time. At no point of time are there opposite currents simultaneously in the circuit. After half a rotation you get the change in direction.
I found this YouTube video particularly helpful myself while understanding this concept as it may get difficult to visualise.
As the magnet turns it pushes electrons through the coil (and circuit since it must be a closed loop) first one direction, then back the other direction as the magnets poles passing the coil change. After one complete revolution the electrons are back approximately where they started (approximately, as no real generator is ideal), so you could say their movements cancelled each other out. But this does not mean no energy was transferred. Think of an incandescent light bulb in your circuit, as electrons are pushed one way through the filament, it starts to get hot, then polarity changes and the electrons are pushed back the other way, the filament gets even hotter. This cycle represents one revolution of the magnet. Eventually the filament will get hot enough to glow, even though the electrons are moving back and forth from their approximate starting point.