Fix: Add rollback to update repository

When update repository, we remove a old repository first then add
a new one, if error occurs when adding new one, old one was removed
which will cause problem.

Fix by recovering removed old repository after failure of adding new one.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>