Yes, you can. The occupying unit remains on that hex. If it is now on invalid terrain, it will follow the rules to get back to valid terrain on its next movement.