Improved updating function and added a rollback function for syncing with GitHub