add restore feature, see README for details