Yes, there are many ways to do so. Most commonly you can use configuration management products, restconf/netconf, and more. Cisco routers (and many other brands) do not commit the configuration as a startup configuration until you issue a second command that commits the running config (running in memory) to the startup config. This allows the router/device to revert back if rebooted.
One point of clarification is that I don't know if Facebook uses Cisco routers for BGP. Facebook is well known for rolling its own routing stack and other services on its own servers.