composer/composer — pull request #2522 by chr0n1x (2013-12-22 05:51:48+00:00)
Title: Feature: --self-update --rollback

Hopefully resolves https://github.com/composer/composer/issues/2371

Given that `${VERSION}` is the version of the running instance of composer:
- `composer self-update` saves a copy of the running `composer.phar` into `$config->get('home')/${VERSION}-old.phar`.
- `composer self-update --rollback` or `composer self-update -r` takes the **last** `$config->get('home') /${OTHER_VERSION}-old.phar` and replaces the running `composer.phar` with that file. This is done via `filemtime()`
- `composer self-update --clean-rollbacks` removes all `$config->get('home')/*-old.phar` files before saving the current `composer.phar` into `$config->get('home')/${VERSION}-old.phar`.