mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-19 19:08:08 +00:00
faq: add entry about accidentally amended working copy
This commit is contained in:
parent
89e5cbd6ef
commit
1c8d27dc39
1 changed files with 11 additions and 0 deletions
11
docs/FAQ.md
11
docs/FAQ.md
|
@ -94,6 +94,17 @@ You'll then need to use `jj new --before` to create new commits
|
|||
and `jj move --to`
|
||||
to move new changes into the correct commits.
|
||||
|
||||
### I accidentally amended the working copy. How do I move the new changes into its own commit?
|
||||
|
||||
Use `jj obslog -p` to see how your working-copy commit has evolved. Find the
|
||||
commit you want to restore the contents to. Let's say the current commit (with
|
||||
the changes intended for a new commit) are in commit X and the state you wanted
|
||||
is in commit Y. Note the commit id (normally in blue at the end of the line in
|
||||
the log output) of each of them. Now use `jj new` to create a new working-copy
|
||||
commit, then run `jj restore --from Y --to @-` to restore the parent commit
|
||||
to the old state, and `jj restore --from X` to restore the new working-copy
|
||||
commit to the new state.
|
||||
|
||||
[config]: config.md
|
||||
|
||||
[gitignore]: https://git-scm.com/docs/gitignore
|
||||
|
|
Loading…
Reference in a new issue