# Restoring Deleted Messages?

**URL:** https://meta.discourse.org/t/restoring-deleted-messages/173647
**Category:** Support
**Created:** [December 17, 2020, 8:35pm UTC](https://meta.discourse.org/t/restoring-deleted-messages/173647 "2020-12-17T20:35:44Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 17, 2020, 10:55pm UTC](https://meta.discourse.org/t/restoring-deleted-messages/173647/2 "2020-12-17T22:55:45Z")

</div>

If you’re self-hosted you can do it from the rails console. If you’re hosted, you can ask support.

There might be some hints over in [Administrative Bulk Operations](https://meta.discourse.org/t/administrative-bulk-operations/118349).

Something like

```plaintext
t=Topic.all.with_deleted.where("deleted_at is not null").where(user_id: 123)
t.update_all(deleted_at: nil, deleted_by_id: nil)

```

But I think you will then need to run something else to update some other tables.

---

_[View the full topic](https://meta.discourse.org/t/restoring-deleted-messages/173647)._
