fix: remove references to git reset

This commit is contained in:
Bjarke Sporring
2026-01-16 10:18:46 +01:00
parent a8e9507f89
commit 6cf0418ebd
2 changed files with 7 additions and 47 deletions

View File

@@ -307,44 +307,6 @@ git merge main
git pull origin main git pull origin main
``` ```
## Troubleshooting
### "I'm on the wrong branch!"
```pwsh
# Switch to the correct branch
git switch correct-branch
# Check current branch anytime
git branch
```
### "I made commits on the wrong branch!"
Don't panic! You can move commits to another branch:
```pwsh
# Create the correct branch from current state
git branch correct-branch
# Switch to wrong branch and remove the commits
git switch wrong-branch
git reset --hard HEAD~2 # Remove last 2 commits (adjust number)
# Switch to correct branch - commits are there!
git switch correct-branch
```
### "The merge created unexpected results!"
```pwsh
# Undo the merge
git merge --abort
# Or if already committed:
git reset --hard HEAD~1
```
### "I want to see what changed in a merge!" ### "I want to see what changed in a merge!"
```pwsh ```pwsh
@@ -368,13 +330,13 @@ git diff main..feature-branch
After completing this module, you understand: After completing this module, you understand:
- Branches create independent lines of development - Branches create independent lines of development
- `git switch -c` creates a new branch - `git switch -c` creates a new branch
- Changes in one branch don't affect others - Changes in one branch don't affect others
- `git merge` combines branches - `git merge` combines branches
- Merge commits have two parent commits - Merge commits have two parent commits
- `git log --graph` visualizes branch history - `git log --graph` visualizes branch history
- Branches are pointers, not copies of files - Branches are pointers, not copies of files
## Next Steps ## Next Steps

View File

@@ -235,5 +235,3 @@ To reuse the repository:
- **Keep groups small** (2 people per repository) for more interaction - **Keep groups small** (2 people per repository) for more interaction
- **Encourage communication** - the exercise works best when people talk - **Encourage communication** - the exercise works best when people talk
- **Let conflicts happen** - they're the best learning opportunity - **Let conflicts happen** - they're the best learning opportunity
- **Walk the room** - help students who get stuck
- **Point students to 03_TASKS.md** - Simple explanations of clone, push, pull, and fetch for beginners