Skip to main content

Frequently used git commands

  1. Empty commit :
    git commit --allow-empty -m "trigger"
  2. Reset uncommitted changes :
    git reset --hard HEAD
  3. Reset last commit :
    git reset --hard HEAD~1
  4. Reset single file :
    git checkout master -- /path/to/filename.txt
  5. Update last commit :
    git commit --amend