Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To receive the new commits</p> <pre><code>git fetch </code></pre> <p><strong>Reset</strong></p> <p>You can reset the commit for a local branch using <code>git reset</code>.</p> <p>To change the commit of a local branch:</p> <pre><code>git reset origin/master --hard </code></pre> <p>Be careful though, as the documentation puts it:</p> <blockquote> <p>Resets the index and working tree. Any changes to tracked files in the working tree since &lt;commit> are discarded.</p> </blockquote> <p>If you want to actually keep whatever changes you've got locally - do a <code>--soft</code> reset instead. Which will update the commit history for the branch, but not change any files in the working directory (and you can then commit them).</p> <p><strong>Rebase</strong></p> <p>You can replay your local commits on top of any other commit/branch using <code>git rebase</code>:</p> <pre><code>git rebase -i origin/master </code></pre> <p>This will invoke rebase in interactive mode where you can choose how to apply each individual commit that isn't in the history you are rebasing on top of.</p> <p>If the commits you removed (with <code>git push -f</code>) have already been pulled into the local history, they will be listed as commits that will be reapplied - they would need to be deleted as part of the rebase or they will simply be re-included into the history for the branch - and reappear in the remote history on the next push.</p> <p>Use the help <code>git command --help</code> for more details and examples on any of the above (or other) commands.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload