Well how much help did you want here? A straight-forward algorithm or just some intuition?
The interesting thing to notice on this puzzle is that any time an edge travels completely around a face and ends in the same spot that it started, it flips orientation.
What you need to do here is find a way to take one of those flipped edges all the way around a face center, and then put the other edge in its place and take it backwards along the same route, fixing everything you messed up with the first piece and simultaneously flipping it as well.
I would honestly try at it a bit longer before you ask for an algorithm, this situation isn't very hard