How can i take all ids from untrash_post action?

You can use transition_post_status:

add_action('transition_post_status', 'wpse_handle_untrash');
function wpse_handle_untrash($new_status, $old_status, $post) {
    // if the post was in the trash, but now is not
    if($old_status == 'trash') {
        // if you want, you can do something only for a certain post type
        if($post->post_type == 'my-desired-post-type') {
            // do something
            echo '<script>alert(' . $post->ID . ');</script>';
        }
    }
}

If you can explain what you’d like to do when a post is untrashed, that will be helpful in getting you a solution to accomplish it. Is a JS alert what you’re ultimately hoping to achieve?

This question may give you some ideas.