Last Updated: February 25, 2016
· hoelzro

Different uses for -p in Git

Many Git users are familiar with git add -p (interactively stage hunks for commit). Not as many are familiar with using -p with other commands. You also do a git reset -p (interactively unstage hunks from the index), git checkout -p (interactively restore hunks to their state in a commit, probably HEAD), or git stash save -p (interactively select hunks for stashing). These variants really come in handy if you like to work in small chunks!