git add .
git add /path/to/file
git reset
unstage all files
git reset /path/to/file
unstage specific file
first
git log
find the commit hash you want
commit 93454a4218c704039cce719bd52e1d816a74047c <-- THIS
Author: Pavel Zagoskin <d4rklit3@wildlife.la>
Date: Mon Feb 29 18:10:38 2016 -0800
then reset it
git reset 93454a4218c704039cce719bd52e1d816a74047c
this will unstage all files in their changed form (in red) from your current HEAD all the way back to that commit. this is usefull for squashing commits. (if you have like 5 commits and you want them to be one commit).
lets say you want to just go back in time to a specific commit and not unstage anything. Just erase all your progress THIS IS DANGEROUS
git reset 93454a4218c704039cce719bd52e1d816a74047c --hard
git commit -m "the message"
make a commit with long message (opens up vi or whatever editor you set to git)
git commit
git fetch
git status
git merge origin/$BRANCH_NAME
Your branch and 'origin/develop' have diverged,
and have 1 and 2 different commit each, respectively.
git rebase origin/$BRANCH_NAME
git push
or
git push origin $BRANCH_NAME
push your current most recent (HEAD) to some other origin branch (you don't need to specify origin/$BRANCH_NAME in this instance. other side of teh colon assumes its on origin)
git push origin HEAD:$OTHER_BRANCH_NAME
also you can just push any branch to any branch in origin
git push origin $ANY_BRANCH:$ANY_OTHER_BRANCH