Skip to content

Instantly share code, notes, and snippets.

@mrpatrick
Created August 9, 2016 20:59
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 mrpatrick/7e8e5aaa3782d085755714830bc0b47b to your computer and use it in GitHub Desktop.
Save mrpatrick/7e8e5aaa3782d085755714830bc0b47b to your computer and use it in GitHub Desktop.
Check the diff between branches and revert single file from specific commit
# Check the diff between branches
git diff release-v2.0.0..Develop public/wp-content/themes/mytheme/my-page.php
# revert single file from specific commit
git checkout 26608ec4a393b0086e02851b6d6f6b72af265a67 public/wp-content/themes/mytheme/my-page.php
# commit (the diff won't show until it's commited)
git commit
# re-diff file (will show no diff)
git checkout 26608ec4a393b0086e02851b6d6f6b72af265a67 public/wp-content/themes/mytheme/my-page.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment