It's possible you're thinking of a specific behavior. Some fish, like seahorses, can swim upright, but they don't actually swim on their backs. They use their dorsal fin to propel themselves vertically.
If you have more information about the fish you're curious about, I might be able to help you further!