# Recuperar uma categoria? (Ou o tópico "sobre esta categoria" que estava nela)

**URL:** <https://meta.discourse.org/t/undelete-a-category-or-the-about-this-category-topic-that-was-under-it/183602>\
**Category:** Product Support\
**Created:** [Março 17, 2021, 11:20pm UTC](https://meta.discourse.org/t/undelete-a-category-or-the-about-this-category-topic-that-was-under-it/183602 "2021-03-17T23:20:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)\
**Post date:** [Março 19, 2021, 7:32pm UTC](https://meta.discourse.org/t/undelete-a-category-or-the-about-this-category-topic-that-was-under-it/183602/3 "2021-03-19T19:32:10Z")

</div>

Acho que  
`./launcher enter app`  
e depois  
`rails c`  
e  
`Topic.with_deleted.where(id: 7078).recover!`

…mas tentei e não funcionou como esperado. Não sei por que 🤔 Acho que você também teria que alterar o category\_id.

Com o número do post, você pode tentar:  
`Post.with_deleted.where(id: the_post_id).pluck("raw")`  
ou, como provavelmente havia apenas um post no tópico:  
`Post.with_deleted.where(topic_id: 7078).pluck("raw")`

Isso deve te dar algo para copiar 🤞

---

_[View the full topic](https://meta.discourse.org/t/undelete-a-category-or-the-about-this-category-topic-that-was-under-it/183602)._
