reset command performs a hard reset of your git repository while carefully preserving all files in the .codegen directory. This is useful for undoing codemod changes while keeping your codemod implementations intact.
Usage
What it Does
When you rungs reset, it:
- Backs up all files in
.codegendirectory, preserving their content and staged/unstaged status - Performs a hard reset (
git reset --hard HEAD) on the repository - Restores all
.codegenfiles to their previous state, including their git staging status - Removes untracked files (except those in
.codegen)
This is more sophisticated than
git checkout . as it:- Preserves both staged and unstaged changes in
.codegen - Handles deleted files correctly
- Removes untracked files (like
git clean) while protecting.codegen