Recover a branch and resolve conflicts

You want to combine several local commits before asking for a review. First check the active branch and save any edits you still need. A safety snapshot records commit references. A stash holds uncommitted changes. They serve different parts of the recovery.

Before editing history

Riff tries to save the current HEAD and its upstream information before operations such as rebase, squash, cherry-pick, merge, revert, reset, amend and force push. It keeps up to 50 snapshots per repository on this computer. An empty repository has no previous commit to restore. Check that Undo is available for the operation you want to reverse.

If Riff asks to stash a dirty working tree, review the changes and confirm or cancel. After the operation, look under Stashes and choose when to apply or pop the entry. Applying keeps the stash. A successful pop restores the changes and removes the entry.

When Git stops on a conflict

  1. Check the operation banner and open a conflicted file. Compare the two versions and the common base where available. During a rebase, read the contents before choosing Ours or Theirs because Git labels the sides from the operation's perspective.
  2. Take one side for the whole file, or use the three-way editor to choose either side, both sides or your own text for each region. Review and save the result.
  3. Resolve the remaining files and choose Continue when the banner allows it. Abort cancels the operation in progress if you want to start again.

Undo, redo and the remote

Undo restores the recorded local commit using a hard reset. Protect current edits before confirming. Redo survives an app restart and checks that HEAD still matches the state left by Undo. If you have moved on, inspect the graph before choosing another operation.

Force push uses --force-with-lease. If the remote branch differs from the revision Git expects, the push is refused. Fetch the new history and inspect the other person's commits. Undo after a push changes your local checkout. Updating the server requires a separate push and the appropriate host permission.

Compare the result in the commit graph.