Revert buffer based on prefix in path.