Skip to content

Instantly share code, notes, and snippets.

@Geoffrey-T
Created December 4, 2020 14:07
Show Gist options
  • Select an option

  • Save Geoffrey-T/16816859a9a3f1948b8aabf4920fe5dd to your computer and use it in GitHub Desktop.

Select an option

Save Geoffrey-T/16816859a9a3f1948b8aabf4920fe5dd to your computer and use it in GitHub Desktop.
Git help kit
# Reset last commit (hard reset, without save changes)
git reset --head HEAD^
# Reset last commit and keep changes in unstages files
git reset --soft HEAD^
# Change original branch -> when you start your dev from the wront branch
git rebase --onto goodBranch wrongBranch # wrongBranch is your wrong started branch
# When you commit unneeded files and forgot to change your giignore file:
git rm -r --cached .
git add .
git commit -m "fix gitignore"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment