# Rollback using doppler cli

**URL:** <https://community.doppler.com/t/rollback-using-doppler-cli/1113>\
**Category:** Need Help\
**Created:** [May 3, 2023, 8:32am UTC](https://community.doppler.com/t/rollback-using-doppler-cli/1113 "2023-05-03T08:32:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dex](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/dex/32/757_2.png) [@Dex](https://community.doppler.com/u/Dex)\
**Post date:** [May 3, 2023, 8:32am UTC](https://community.doppler.com/t/rollback-using-doppler-cli/1113/1 "2023-05-03T08:32:28Z")

</div>

Hello Team Doppler,

How can I Rollback using doppler cli? any ideas?

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [May 3, 2023, 3:36pm UTC](https://community.doppler.com/t/rollback-using-doppler-cli/1113/2 "2023-05-03T15:36:59Z")

</div>

Hi @Dex!

Yep, you can! It’s a little hard to find because rollbacks are actually associated with logs rather than secrets. So, rather than rolling back a particular secret, you’re rolling back a change in the audit logs.

You can view your audit logs using this command:

```shell
doppler configs logs -p PROJECT -c CONFIG

```

Then, to perform a rollback, copy the log ID (which looks something like this: `O1BNdCFtlJ8q1bxCoQhOIV0P`), and use it in a command like this:

```shell
doppler configs logs rollback -p PROJECT -c CONFIG O1BNdCFtlJ8q1bxCoQhOIV0P

```

Let me know if you run into any issues!

Regards,  
-Joel

---

<div class="post-metadata">

**Author:** ![Dex](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/dex/32/757_2.png) [@Dex](https://community.doppler.com/u/Dex)\
**Post date:** [May 4, 2023, 1:44am UTC](https://community.doppler.com/t/rollback-using-doppler-cli/1113/3 "2023-05-04T01:44:08Z")

</div>

Thank you so much watsonian. appreciate your reply.

---

<div class="post-metadata">

**Author:** ![Dex](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/dex/32/757_2.png) [@Dex](https://community.doppler.com/u/Dex)\
**Post date:** [May 8, 2023, 2:40am UTC](https://community.doppler.com/t/rollback-using-doppler-cli/1113/4 "2023-05-08T02:40:13Z")

</div>

Hi again so on the cli it cant show the before and after value?  
per checking its shows only like this

> Log Y7i5iUaxcSsM4dz4BOp16e5D  
> User: USERNAME [username@companyname.com](mailto:username@companyname.com)  
> Date: 2023-05-08 09:51:38.055 +0800 PST  
> Modified secrets and saved to vault`Preformatted text`

not like on the ui you can see it.

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [May 8, 2023, 3:14pm UTC](https://community.doppler.com/t/rollback-using-doppler-cli/1113/5 "2023-05-08T15:14:58Z")

</div>

@Dex You can view the diff, but you need to use `doppler configs logs get -p PROJECT -c CONFIG [LOG_ID]` to view it.

---

<div class="post-metadata">

**Author:** ![Dex](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/dex/32/757_2.png) [@Dex](https://community.doppler.com/u/Dex)\
**Post date:** [May 11, 2023, 6:12am UTC](https://community.doppler.com/t/rollback-using-doppler-cli/1113/6 "2023-05-11T06:12:34Z")

</div>

> [@watsonian](#):
>
> `doppler configs logs rollback`

hello @watsonian,

I thinks there’s an issue regarding a rollback command if the value is a Across Project using secret referencing…

So here’s what I encouter on the config I update the Key-Value pair  
from TEST=${test-project.env.REFERENCE\_1} to TEST=value2

then I tried to get first the previous log\_id then rollback it using the command that you gave

`doppler configs logs rollback -p PROJECT -c [LOG_ID]`

the output is like this

> -TEST=value2  
> +TEST=

its blank.

then I run the command again with same log\_id

> -TEST=  
> +TEST=${test-project.env.REFERENCE\_1}

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [May 11, 2023, 2:57pm UTC](https://community.doppler.com/t/rollback-using-doppler-cli/1113/7 "2023-05-11T14:57:02Z")

</div>

Hi @Dex,

I couldn’t reproduce what you’re seeing. Here’s what happened in my test:

```shell
❯ doppler configs logs -p example -c dev
Log NsjHS2iReclIf3K7lKUnsCh4
User: Joel Watson <joel.watson@doppler.com>
Date: 2023-05-11 09:54:37.222 -0500 CDT

	Modified secrets and saved to vault

Log G7L4WiYlQUOb0MbNs12TZVAi
User: Joel Watson <joel.watson@doppler.com>
Date: 2023-05-11 09:54:30.142 -0500 CDT

	Modified secrets and saved to vault
....

❯ doppler configs logs -p example -c dev rollback NsjHS2iReclIf3K7lKUnsCh4
Log A3jjhxDqyusTgq9kYxSmYHO2
User: Joel Watson <joel.watson@doppler.com>
Date: 2023-05-11 09:54:52.514 -0500 CDT

	Modified secrets and saved to vault

-FOO=abcd
+FOO=${test.dev.TEST}

```

In `NsjHS2iReclIf3K7lKUnsCh4` I changed the reference to the value `abcd`. In `G7L4WiYlQUOb0MbNs12TZVAi` I set the secret to the reference. I then rolled back `NsjHS2iReclIf3K7lKUnsCh4` to revert the change and got the expected output.

The only thing I did notice in the command you posted was that you seemed to be passing the `LOG_ID` into the `-c` parameter, which should be taking the config name. Maybe that’s your issue here?

Regards,  
-Joel
