You have made changes to files but want to switch branches without committing. What does git stash do with your changes?
Think about how you can save work without committing it yet.
git stash temporarily saves your uncommitted changes and cleans your working directory so you can switch branches or work on something else. The changes are not lost but stored safely until you apply them back.
You run git stash after modifying some files. What will git stash list show?
git stash git stash list
What does git stash list show after you stash changes?
After stashing, git stash list shows a list of saved stashes with identifiers like stash@{0} and the branch and commit info where the stash was made.
Arrange the steps in the correct order to save your work temporarily and then restore it later using git stash.
Think about saving first, then switching branches, then restoring.
You first save your changes with git stash, then switch branches safely, and later restore your changes with git stash apply to continue working.
You stashed changes on branch A, switched to branch B, and ran git stash apply. It failed with conflicts. Why?
Think about what happens if your saved changes clash with current files.
If the changes saved in the stash conflict with the current branch's files, git stash apply will show conflicts that you must resolve manually.
Which reason best explains why using git stash is better than committing unfinished work to the repository?
Think about how your project history looks with many small unfinished commits.
Using git stash lets you save work temporarily without cluttering the commit history with incomplete or experimental changes, keeping the project history clean and meaningful.