Skip to main content
Active reading.
Source Link
Peter Mortensen
  • 31.3k
  • 22
  • 109
  • 132

You can unstage/undo or undo using the gitgit command or GUI gitGit.

Single file

git reset File.txt 

Multiple files

git reset File1.txt File2.txt File3.txt

Example

Example - Suppose Suppose you have added Home.js, ListItem.js, Update.js by mistake  ,

enter image description hereEnter image description here and

and want to undo/reset =>

git reset src/components/home/Home.js src/components/listItem/ListItem.js src/components/update/Update.js

enter image description hereEnter image description here

Same ExampleThe same example using gitGit GUI

git gui

opensOpens a window =>. Uncheck your files from Staged changes  (Will Commitwill commit)   

enter image description hereEnter image description here

You can unstage/undo using the git command or GUI git.

Single file

git reset File.txt 

Multiple files

git reset File1.txt File2.txt File3.txt

Example - Suppose you have added Home.js, ListItem.js, Update.js by mistake  enter image description here and want to undo/reset =>

git reset src/components/home/Home.js src/components/listItem/ListItem.js src/components/update/Update.js

enter image description here

Same Example using git GUI

git gui

opens a window => Uncheck your files from Staged changes(Will Commit)  enter image description here

You can unstage or undo using the git command or GUI Git.

Single file

git reset File.txt

Multiple files

git reset File1.txt File2.txt File3.txt

Example

Suppose you have added Home.js, ListItem.js, Update.js by mistake,

Enter image description here

and want to undo/reset =>

git reset src/components/home/Home.js src/components/listItem/ListItem.js src/components/update/Update.js

Enter image description here

The same example using Git GUI

git gui

Opens a window. Uncheck your files from Staged changes  (will commit) 

Enter image description here

Source Link
akhtarvahid
  • 9.7k
  • 2
  • 29
  • 32

You can unstage/undo using the git command or GUI git.

Single file

git reset File.txt 

Multiple files

git reset File1.txt File2.txt File3.txt

Example - Suppose you have added Home.js, ListItem.js, Update.js by mistake enter image description here and want to undo/reset =>

git reset src/components/home/Home.js src/components/listItem/ListItem.js src/components/update/Update.js

enter image description here

Same Example using git GUI

git gui

opens a window => Uncheck your files from Staged changes(Will Commit) enter image description here