Skip to content

Instantly share code, notes, and snippets.

@reterVision
Created January 7, 2013 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reterVision/4475381 to your computer and use it in GitHub Desktop.
Save reterVision/4475381 to your computer and use it in GitHub Desktop.
# Sometimes we could mistakenly commit something without pull first, so
# here is how we revert this process and keep our master branch clean.
# Reset back to the commit before you last commit.
# git reset --mixed will keep your changes and revert other files back
# to that commit.
git pull
git reset --mixed HEAD-before-your-last-commit
# Commit your changes again.
git add .
git commit -m "Your newest commit message"
# Push to origin then all settled.
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment