Git - How to revert uncommitted changes including files and folders

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

Is there a git command to revert all uncommitted changes in a working tree and index and to also remove newly created files and folders?

Answers

You can run these two commands:

# Revert changes to modified files.
git reset --hard

# Remove all untracked files and directories. (`-f` is `force`, `-d` is `remove directories`)
git clean -fd

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/5807137/how-to-revert-uncommitted-changes-including-files-and-folders

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils