Rescue and restore index between commits