Liquid water is being sliced off into H2 and O2 gas. If water was just boiled and became vapor, it would be physical change, however, in electrolysis it became two different elements. Therefore, it's chemical change.
If pressure and temperature is enough, reverse reaction can always occur to form water again. That's actually the behind mechanism of hydrogen gas fuel. Liquid H2 gas burns with O2 gas to produce water.
So, we can form up water again using hydrogen and oxygen in the process of electrolysis by providing enough pressure and temperature