Skip to content

Instantly share code, notes, and snippets.

@tcartwright
Created October 16, 2025 18:59
Show Gist options
  • Save tcartwright/e3eabcc8ac127e8d03424ca061385b28 to your computer and use it in GitHub Desktop.
Save tcartwright/e3eabcc8ac127e8d03424ca061385b28 to your computer and use it in GitHub Desktop.
CMD: Git undo changes to a file when git or visual studio wont let you
git rm .gitattributes # Removes the .gitattributes file from both the working directory and the Git index (staging area).
git add -A # Stages all changes: added files, modified files, and deletions (like the .gitattributes removal) for the next commit.
git reset --hard # Resets the working directory and index to the last committed state — all staged and unstaged changes are lost.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment