# Show list of local branches and highlight a current working branch
git branch
# Show all branches in local and remote repositories
git branch -a
# Show only remote branches
git branch -r# all merged
git branch --merged master
# all not merged yet
git branch --no-merged master
# or all local and remote
git branch -r --no-merged origin/masterSource: StackOverflow
# Print out the list of files which will be removed (dry run)
git clean -n
# Delete the files from the repository
git clean -f
# Remove untracked files, including directories (-d) and files ignored by git (-x)
git clean -d -x -fSource: StackOverflow
Alternative solution:
# Discard uncommitted changes in a specific file
git checkout thefiletoreset.txt
# To reset the entire repository to the last committed state
git reset --hardSource: StackOverflow
Source: Atlassian
- Advanced Git Tutorials by Atlassian