# How to safely revert my changes in the container

**URL:** <https://meta.discourse.org/t/how-to-safely-revert-my-changes-in-the-container/188043>\
**Category:** Support\
**Created:** [April 25, 2021, 9:07am UTC](https://meta.discourse.org/t/how-to-safely-revert-my-changes-in-the-container/188043 "2021-04-25T09:07:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)\
**Post date:** [April 25, 2021, 9:07am UTC](https://meta.discourse.org/t/how-to-safely-revert-my-changes-in-the-container/188043/1 "2021-04-25T09:07:47Z")

</div>

To fix a problem, I had to do some manual changes in code inside the discourse container. Now how can I safely revert back all the changes?

---

<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:** [April 25, 2021, 12:03pm UTC](https://meta.discourse.org/t/how-to-safely-revert-my-changes-in-the-container/188043/2 "2021-04-25T12:03:56Z")

</div>

If what you want is a container that has the current code, the simplest solution is to rebuild and get a new container.

Another way would be to use git to revert the changes you made. (you can Google how to do that).

---

<div class="post-metadata">

**Author:** ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)\
**Post date:** [April 25, 2021, 12:48pm UTC](https://meta.discourse.org/t/how-to-safely-revert-my-changes-in-the-container/188043/3 "2021-04-25T12:48:54Z")

</div>

> [@pfaffman](#):
>
> Another way would be to use git to revert the changes you made. (you can Google how to do that).

you mean:

```plaintext
cd /var/discourse
./launcher enter app
git reset --hard
git clean -fxd

```

will do the job?

---

<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:** [April 25, 2021, 2:38pm UTC](https://meta.discourse.org/t/how-to-safely-revert-my-changes-in-the-container/188043/4 "2021-04-25T14:38:37Z")

</div>

I think so. I’d recommend rebuilding a new container, though..

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [May 25, 2021, 2:39pm UTC](https://meta.discourse.org/t/how-to-safely-revert-my-changes-in-the-container/188043/5 "2021-05-25T14:39:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
