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
```
## 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