Handle revert for sorting data