Skip to content

Instantly share code, notes, and snippets.

@aeinbu
Last active February 12, 2025 14:47
Show Gist options
  • Select an option

  • Save aeinbu/dbdd2fbdee37cbb87ce0ebf36404f089 to your computer and use it in GitHub Desktop.

Select an option

Save aeinbu/dbdd2fbdee37cbb87ce0ebf36404f089 to your computer and use it in GitHub Desktop.

Revisions

  1. aeinbu revised this gist Feb 12, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion git-stuff.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    Example:
    ``` shell
    git reset --soft HEAD^

    ```


    # Navigating git
  2. aeinbu revised this gist Feb 12, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions git-stuff.md
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@ Example:
    git reset --soft HEAD^



    # Navigating git
    Shortcuts for path-specs
    - `HEAD` is the current commit
  3. aeinbu revised this gist Feb 12, 2025. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions git-stuff.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,11 @@
    - `git reset --mixed`, any changes are left as unstaged
    - `git reset --hard`, any changes are discarded

    Example:
    ``` shell
    git reset --soft HEAD^


    # Navigating git
    Shortcuts for path-specs
    - `HEAD` is the current commit
  4. aeinbu created this gist Feb 12, 2025.
    11 changes: 11 additions & 0 deletions git-stuff.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # git reset

    - `git reset --soft`, any changes are left as staged (or "ready to commit")
    - `git reset --mixed`, any changes are left as unstaged
    - `git reset --hard`, any changes are discarded

    # Navigating git
    Shortcuts for path-specs
    - `HEAD` is the current commit
    - `HEAD^` is the same as `HEAD~1`, meaning one commit back from current commit
    - `HEAD^^` is the same as `HEAD~2`, meaning two commits back from current commit