I was building a small underground farm when I accidentally fell into my water patch. I tried to get out of it, but when I jumped up on to the farmland, I got stuck on the farmland and could only move backward back into the water. I tried it again and got the same result. There were only two blocks of space in between the farmland and the ceiling, so that might have an effect.
Eventually, I started jumping like crazy and managed to place a block underneath me and got out.
Edit: I raised the ceiling by one block and it still had the same stuck effect. However, I placed a trapdoor over the water and know you kind of just orbit around it but can move sideways and get away.