You can use the --prefer-source
flag for composer to checkout external packages with the VCS information (if any available). You can simply revert to the original state. Also if you issue the composer update
command composer will detect any changes you made locally and ask if you want to discard them.
Your .gitignore file is related to your root project (ZF2 skeleton) and it prevents the vendor dir (where your third party libs are) from committing to your own VCS. The ignore file is unrelated to the git repo's of your vendors.