refactor-reset-revert #3

Merged
floppydiscen merged 2 commits from refactor-reset-revert into main 2026-01-16 09:19:42 +00:00
2 changed files with 7 additions and 47 deletions
Showing only changes of commit 6cf0418ebd - Show all commits

View File

@@ -307,44 +307,6 @@ git merge 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!"
```pwsh
@@ -368,13 +330,13 @@ git diff main..feature-branch
After completing this module, you understand:
- Branches create independent lines of development
- `git switch -c` creates a new branch
- Changes in one branch don't affect others
- `git merge` combines branches
- Merge commits have two parent commits
- `git log --graph` visualizes branch history
- Branches are pointers, not copies of files
- Branches create independent lines of development
- `git switch -c` creates a new branch
- Changes in one branch don't affect others
- `git merge` combines branches
- Merge commits have two parent commits
- `git log --graph` visualizes branch history
- Branches are pointers, not copies of files
## Next Steps

View File

@@ -235,5 +235,3 @@ To reuse the repository:
- **Keep groups small** (2 people per repository) for more interaction
- **Encourage communication** - the exercise works best when people talk
- **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