Since the backup was useless because it didn't contain ipv6, I should had done another backup for ipv6 like this:
ip6tables-save
I solved it by restoring the iptables to the original state at boot time using rc.local. So, when booting into recovery I edited this file:
nano /etc/rc.d/rc.local
# Temporary commands to run once at startup to reset iptables to original state
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
ip6tables -F
ip6tables -X
ip6tables -t nat -F
ip6tables -t nat -X
ip6tables -t mangle -F
ip6tables -t mangle -X
ip6tables -P INPUT ACCEPT
ip6tables -P FORWARD ACCEPT
ip6tables -P OUTPUT ACCEPT
#chmod +x rc.local
Then, I rebooted the system. The above script will run, and now I can access my server.
After everything is ok, then I removed all the above commands to prevent auto run again for the second time.