The storage on an EC2 instance is ephemeral, and is gone when that instance terminates. Rather than uploading your codebase to that specific instance manually, you should let Elastic Beanstalk do it for you. That way, you application's code base, including previous versions of it, are stored with Elastic Beanstalk, which is automatically deployed to new instances when they are spun up.
For example, for a PHP application, this link explains how it can be deployed using Elastic Beanstalk: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP_eb.html