2023-06-05 16:13:08 +03:00
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.merge
|
2023-06-05 16:13:08 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
```unison
|
2024-07-06 02:55:07 +03:00
|
|
|
def = "first value"
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm:hide
|
|
|
|
scratch/main> update
|
2023-06-05 16:13:08 +03:00
|
|
|
```
|
|
|
|
|
2024-07-06 02:55:07 +03:00
|
|
|
```unison:hide
|
|
|
|
def = "second value"
|
|
|
|
```
|
|
|
|
|
|
|
|
Can reset to a value from history by number.
|
|
|
|
|
2023-06-05 16:13:08 +03:00
|
|
|
```ucm
|
2024-07-06 02:55:07 +03:00
|
|
|
scratch/main> update
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> history
|
|
|
|
scratch/main> reset 2
|
2024-07-06 02:55:07 +03:00
|
|
|
scratch/main> view def
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> history
|
2023-06-05 16:13:08 +03:00
|
|
|
```
|
|
|
|
|
2024-07-06 02:55:07 +03:00
|
|
|
Can reset to a value from reflog by number.
|
2023-06-05 16:13:08 +03:00
|
|
|
|
|
|
|
```ucm
|
2024-07-06 02:55:07 +03:00
|
|
|
scratch/main> reflog
|
|
|
|
-- Reset the current branch to the first history element
|
|
|
|
scratch/main> reset 2
|
|
|
|
scratch/main> view def
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> history
|
2023-06-05 16:13:08 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
# reset branch
|
|
|
|
|
|
|
|
```ucm
|
|
|
|
foo/main> history
|
|
|
|
```
|
|
|
|
|
2024-07-06 02:55:07 +03:00
|
|
|
```unison:hide
|
2023-06-05 16:13:08 +03:00
|
|
|
a = 5
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
|
|
|
foo/main> update
|
2024-07-11 19:38:50 +03:00
|
|
|
foo/empty> reset /main:
|
2024-07-06 02:55:07 +03:00
|
|
|
foo/empty> view a
|
|
|
|
foo/empty> history
|
2023-06-05 16:13:08 +03:00
|
|
|
```
|
|
|
|
|
2024-07-06 02:55:07 +03:00
|
|
|
## second argument is always interpreted as a branch
|
|
|
|
```unison:hide
|
2023-06-05 16:13:08 +03:00
|
|
|
main.a = 3
|
|
|
|
```
|
|
|
|
|
2024-07-06 02:55:07 +03:00
|
|
|
```ucm
|
|
|
|
foo/main> update
|
2023-06-05 16:13:08 +03:00
|
|
|
foo/main> history
|
|
|
|
foo/main> reset 2 main
|
|
|
|
```
|