Add restore function for wavelet tree.