Skip to main content

Scenarios You'll Probably Hit

"My push failed, it says rejected"

Someone else pushed before you. Do a Pull first (it will merge/rebase your changes together), resolve any conflicts, then Push again.

"I want to throw away all my local changes and start over"

Right-click each file → Discard, or if there are many, right-click the branch/working copy → Discard All Changes.

danger

Cannot be undone.

"I committed to the wrong branch"

Reset (soft) the commit off the wrong branch, checkout the right branch, then cherry-pick or re-commit there.

"I want to grab just one specific commit from another branch"

Cherry-pick: right-click the commit on the other branch → Cherry Pick.

tip

In SourceTree, the graph view in the main window is the best "visual" aid — each circle = a commit, each line that branches off = a branch, where they join = a merge.