If you’ve made an error and changed all of the water in your tank instead of doing a partial water change it’s not the end of the world. There are a few things you can do to help yourself and your fish.
The problem with complete water changes is you are potentially killing off many of the helpful microbes that live in your tank. You are also stressing your fish, who had become accustomed to the water he’d been living in.
Water parameters will swing widely after a full water change, and that’s not good for your betta. A partial water change ensures your microbe colonies stay intact and that your betta doesn’t suffer unnecessarily stress.
Your tank will eventually come back to normal, and hopefully your betta has not been harmed. The concern is for the water quality while this is happening. In a properly functioning (cycled) tank there is equilibrium between the waste your betta makes and the microbes that handle that waste. By performing a full water change you’ve potentially sent that process into disarray.
As a result, waste chemicals may rise to levels that can harm your fish. The only way to know for sure if this is happening is to test your water and get readings for ammonia, nitrite and nitrate. You want your ammonia and nitrite at zero, and your nitrate under 20 or 30 ppm (some fish keepers are fine with nitrates as high as 50).
Test every day, and if you are seeing higher numbers change a small amount of the water (~20%) without bothering the filter or substrate. The idea is to dilute those waste chemicals until your tank cycles back around.
Hopefully your tests will show you’ve not done much damage and things will come back to normal fairly quickly. Then, stick with partial water changes.